This is the init way in Halide
While this is the way in tvm
EXPORT Expr::Expr(int8_t x) : Expr(Internal::IntImm::make(Int(8), x)) {} EXPORT Expr::Expr(int16_t x) : Expr(Internal::IntImm::make(Int(16), x)) {} EXPORT Expr::Expr(int32_t x) : Expr(Internal::IntImm::make(Int(32), x)) {} EXPORT Expr::Expr(int64_t x) : Expr(Internal::IntImm::make(Int(64), x)) {} EXPORT Expr::Expr(uint8_t x) : Expr(Internal::UIntImm::make(UInt(8), x)) {} EXPORT Expr::Expr(uint16_t x) : IRHandle(Internal::UIntImm::make(UInt(16), x)) {} EXPORT Expr::Expr(uint32_t x) : IRHandle(Internal::UIntImm::make(UInt(32), x)) {} EXPORT Expr::Expr(uint64_t x) : IRHandle(Internal::UIntImm::make(UInt(64), x)) {} EXPORT Expr::Expr(float16_t x) : IRHandle(Internal::FloatImm::make(Float(16), (double)x)) {} EXPORT Expr::Expr(float x) : IRHandle(Internal::FloatImm::make(Float(32), x)) {} EXPORT Expr::Expr(double x) : IRHandle(Internal::FloatImm::make(Float(64), x)) {} EXPORT Expr::Expr(const std::string &s) : IRHandle(Internal::StringImm::make(s)) {}
Why using Expr
to init Expr
on casse int8, int16, int32, int64 and uint8.
While others using IRHandle