tvm
expr.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
24 #ifndef TVM_IR_EXPR_H_
25 #define TVM_IR_EXPR_H_
26 
27 #include <tvm/ir/source_map.h>
28 #include <tvm/ir/type.h>
29 #include <tvm/node/node.h>
31 #include <tvm/runtime/object.h>
32 
33 #include <algorithm>
34 #include <functional>
35 #include <limits>
36 #include <string>
37 #include <type_traits>
38 
39 namespace tvm {
40 
42 
43 // Forward-declare VirtualDevice to avoid circular imports.
44 class VirtualDevice;
45 
50 class BaseExprNode : public Object {
51  public:
56  mutable Span span;
57 
58  static constexpr const char* _type_key = "BaseExpr";
59  static constexpr const bool _type_has_method_sequal_reduce = true;
60  static constexpr const bool _type_has_method_shash_reduce = true;
61  static constexpr const uint32_t _type_child_slots = 62;
63 };
64 
69 class BaseExpr : public ObjectRef {
70  public:
72 };
73 
86 class PrimExprNode : public BaseExprNode {
87  public:
103 
105 
106  static constexpr const char* _type_key = "PrimExpr";
107  static constexpr const uint32_t _type_child_slots = 38;
109 };
110 
115 class PrimExpr : public BaseExpr {
116  public:
121  TVM_DLL PrimExpr(int32_t value); // NOLINT(*)
126  TVM_DLL PrimExpr(float value); // NOLINT(*)
127 
129  DataType dtype() const { return static_cast<const PrimExprNode*>(get())->dtype; }
130 
132 
133  private:
134  // Internal function for conversion.
136  TVM_DLL static PrimExpr FromObject_(ObjectRef ref);
137 };
138 
149 
160 
170 
181 
192 
203 
214 
225 
236 
247 
258 
269 
280 
290 
300 
309 
320 
331 
342 
352 
362 class RelayExprNode : public BaseExprNode {
363  public:
370  mutable Type checked_type_ = Type(nullptr);
371 
378 
382  inline const Type& checked_type() const;
393  template <typename TTypeNode>
394  inline const TTypeNode* type_as() const;
395 
419 
432 
433  static constexpr const char* _type_key = "RelayExpr";
434  static constexpr const uint32_t _type_child_slots = 22;
436 };
437 
442 class RelayExpr : public BaseExpr {
443  public:
445 };
446 
447 class GlobalVar;
456 class GlobalVarNode : public RelayExprNode {
457  public:
460 
462  v->Visit("name_hint", &name_hint);
463  v->Visit("virtual_device_", &virtual_device_);
464  v->Visit("span", &span);
465  v->Visit("_checked_type_", &checked_type_);
466  v->Visit("struct_info_", &struct_info_);
467  }
468 
469  bool SEqualReduce(const GlobalVarNode* other, SEqualReducer equal) const {
470  // name matters for global var.
471  return equal(name_hint, other->name_hint) && equal.FreeVarEqualImpl(this, other);
472  }
473 
474  void SHashReduce(SHashReducer hash_reduce) const {
475  hash_reduce(name_hint);
476  hash_reduce.FreeVarHashImpl(this);
477  }
478 
479  static constexpr const char* _type_key = "GlobalVar";
481 };
482 
487 class GlobalVar : public RelayExpr {
488  public:
489  TVM_DLL explicit GlobalVar(String name_hint, Type type = {}, Span span = {});
490 
493 };
494 
495 // PrimExprs that are useful as runtime containers.
496 //
501 class IntImmNode : public PrimExprNode {
502  public:
504  int64_t value;
505 
507  v->Visit("dtype", &dtype);
508  v->Visit("value", &value);
509  v->Visit("span", &span);
510  }
511 
512  bool SEqualReduce(const IntImmNode* other, SEqualReducer equal) const {
513  return equal(dtype, other->dtype) && equal(value, other->value);
514  }
515 
516  void SHashReduce(SHashReducer hash_reduce) const {
517  hash_reduce(dtype);
518  hash_reduce(value);
519  }
520 
521  static constexpr const char* _type_key = "IntImm";
523 };
524 
530 class IntImm : public PrimExpr {
531  public:
538  TVM_DLL IntImm(DataType dtype, int64_t value, Span span = Span());
539 
542 };
543 
548 class FloatImmNode : public PrimExprNode {
549  public:
551  double value;
552 
554  v->Visit("dtype", &dtype);
555  v->Visit("value", &value);
556  v->Visit("span", &span);
557  }
558 
559  bool SEqualReduce(const FloatImmNode* other, SEqualReducer equal) const {
560  return equal(dtype, other->dtype) && equal(value, other->value);
561  }
562 
563  void SHashReduce(SHashReducer hash_reduce) const {
564  hash_reduce(dtype);
565  hash_reduce(value);
566  }
567 
568  static constexpr const char* _type_key = "FloatImm";
570 };
571 
577 class FloatImm : public PrimExpr {
578  public:
585  TVM_DLL FloatImm(DataType dtype, double value, Span span = Span());
586 
589 };
590 
597 class Bool : public IntImm {
598  public:
599  explicit Bool(bool value, Span span = Span()) : IntImm(DataType::Bool(), value, span) {}
600  Bool operator!() const { return Bool((*this)->value == 0); }
601  operator bool() const { return (*this)->value != 0; }
602 
604 };
605 
606 // Overload operators to make sure we have the most fine grained types.
607 inline Bool operator||(const Bool& a, bool b) { return Bool(a.operator bool() || b); }
608 inline Bool operator||(bool a, const Bool& b) { return Bool(a || b.operator bool()); }
609 inline Bool operator||(const Bool& a, const Bool& b) {
610  return Bool(a.operator bool() || b.operator bool());
611 }
612 inline Bool operator&&(const Bool& a, bool b) { return Bool(a.operator bool() && b); }
613 inline Bool operator&&(bool a, const Bool& b) { return Bool(a && b.operator bool()); }
614 inline Bool operator&&(const Bool& a, const Bool& b) {
615  return Bool(a.operator bool() && b.operator bool());
616 }
617 
618 inline bool operator==(const Bool& a, bool b) { return a.operator bool() == b; }
619 inline bool operator==(bool a, const Bool& b) { return a == b.operator bool(); }
620 inline bool operator==(const Bool& a, const Bool& b) {
621  return a.operator bool() == b.operator bool();
622 }
623 
632 class Integer : public IntImm {
633  public:
634  Integer() {}
638  explicit Integer(ObjectPtr<Object> node) : IntImm(node) {}
642  Integer(int value, Span span = Span()) : IntImm(DataType::Int(32), value, span) {} // NOLINT(*)
647  Integer(IntImm other) : IntImm(std::move(other)) {} // NOLINT(*)
653  template <typename Enum, typename = typename std::enable_if<std::is_enum<Enum>::value>::type>
654  explicit Integer(Enum value) : Integer(static_cast<int>(value)) {
655  static_assert(std::is_same<int, typename std::underlying_type<Enum>::type>::value,
656  "declare enum to be enum int to use visitor");
657  }
662  Integer& operator=(const IntImm& other) {
663  data_ = ObjectRef::GetDataPtr<Object>(other);
664  return *this;
665  }
669  int64_t IntValue() const {
670  ICHECK(data_ != nullptr) << " Trying to reference a null Integer";
671  return (*this)->value;
672  }
673  // comparators
674  Bool operator==(int other) const {
675  if (data_ == nullptr) return Bool(false);
676  return Bool((*this)->value == other);
677  }
678  Bool operator!=(int other) const { return !(*this == other); }
679  template <typename Enum, typename = typename std::enable_if<std::is_enum<Enum>::value>::type>
680  Bool operator==(Enum other) const {
681  return *this == static_cast<int>(other);
682  }
683  template <typename Enum, typename = typename std::enable_if<std::is_enum<Enum>::value>::type>
684  Bool operator!=(Enum other) const {
685  return *this != static_cast<int>(other);
686  }
687 };
688 
690 class RangeNode : public Object {
691  public:
697  mutable Span span;
701  : min(min), extent(extent), span(span) {}
702 
704  v->Visit("min", &min);
705  v->Visit("extent", &extent);
706  v->Visit("span", &span);
707  }
708 
709  bool SEqualReduce(const RangeNode* other, SEqualReducer equal) const {
710  return equal(min, other->min) && equal(extent, other->extent);
711  }
712 
713  void SHashReduce(SHashReducer hash_reduce) const {
714  hash_reduce(min);
715  hash_reduce(extent);
716  }
717 
718  static constexpr const char* _type_key = "Range";
719  static constexpr const bool _type_has_method_sequal_reduce = true;
720  static constexpr const bool _type_has_method_shash_reduce = true;
722 };
723 
725 class Range : public ObjectRef {
726  public:
733  TVM_DLL Range(PrimExpr begin, PrimExpr end, Span span = Span());
744  static Range FromMinExtent(PrimExpr min, PrimExpr extent, Span span = Span());
745  // declare range.
747 };
748 
749 // implementations
750 inline const Type& RelayExprNode::checked_type() const {
751  ICHECK(checked_type_.defined()) << "internal error: the type checker has "
752  << "not populated the checked_type "
753  << "field for " << GetRef<RelayExpr>(this);
754  return this->checked_type_;
755 }
756 
757 template <typename TTypeNode>
758 inline const TTypeNode* RelayExprNode::type_as() const {
759  static_assert(std::is_base_of<TypeNode, TTypeNode>::value,
760  "TType must be a special case of type");
761  ICHECK(checked_type_.defined())
762  << "Type inference for this Expr has not completed. Try to call infer_type pass.";
763  const TTypeNode* node = checked_type_.as<TTypeNode>();
764  ICHECK(node != nullptr) << "Expected type to be " << TTypeNode::_type_key << ", but get "
765  << checked_type_->GetTypeKey();
766  return node;
767 }
768 
769 } // namespace tvm
770 
771 namespace tvm {
772 namespace runtime {
773 // common rule for RetValue and ArgValue
774 template <>
776  static PrimExpr From(const TVMPODValue_& val) {
777  if (val.type_code() == kTVMNullptr) {
778  return PrimExpr(ObjectPtr<Object>(nullptr));
779  }
780  if (val.type_code() == kDLInt) {
781  int64_t value = val.operator int64_t();
783  return IntImm(runtime::DataType::Int(64), value);
784  }
785  return IntImm(runtime::DataType::Int(32), val.operator int());
786  }
787  if (val.type_code() == kDLFloat) {
788  return FloatImm(runtime::DataType::Float(32), val.operator double());
789  }
790 
791  return PrimExpr::FromObject_(val.AsObjectRef<ObjectRef>());
792  }
793 };
794 
795 template <>
797  static tvm::Integer From(const TVMPODValue_& val) {
798  if (val.type_code() == kTVMNullptr) {
799  return Integer(ObjectPtr<Object>(nullptr));
800  }
801  if (val.type_code() == kTVMArgInt) {
802  return Integer(val.operator int());
803  }
804  return val.AsObjectRef<tvm::Integer>();
805  }
806 };
807 
808 template <>
810  static tvm::Bool From(const TVMPODValue_& val) {
811  if (val.type_code() == kTVMNullptr) {
812  return Bool(ObjectPtr<Object>(nullptr));
813  }
814  if (val.type_code() == kTVMArgInt) {
815  int v = val.operator int();
816  ICHECK(v == 0 || v == 1) << "ValueError: boolean value can only be 0 or 1, but get " << v;
817  return Bool(static_cast<bool>(v));
818  }
819  return val.AsObjectRef<tvm::Bool>();
820  }
821 };
822 
823 } // namespace runtime
824 } // namespace tvm
825 
826 /* \brief Allow tvm.GLobalVar as key in STL tables
827  *
828  * For most IR expressions, it would be ambiguous whether the
829  * expression should follow reference equality or structural equality.
830  * This is not the case for variables, which do not contain nested
831  * internal structure, and are frequently used as keys in lookup
832  * tables.
833  *
834  * Providing `std::hash` and `std::equal_to` specializations for
835  * `tvm::GlobalVar` allows it to be used as a key in STL tables. For
836  * other IR expressions, the user must specify the type of equality
837  * used (e.g. `std::unordered_set<T, StructuralHash, StructuralEqual>`
838  * or `std::unordered_set<T, ObjectPtrHash, ObjectPtrEqual>`).
839  */
840 template <>
841 struct std::hash<tvm::GlobalVar> {
842  std::size_t operator()(const tvm::GlobalVar& var) const {
844  }
845 };
846 
847 template <>
848 struct std::equal_to<tvm::GlobalVar> {
849  bool operator()(const tvm::GlobalVar& var_a, const tvm::GlobalVar& var_b) const {
850  return tvm::runtime::ObjectPtrEqual()(var_a, var_b);
851  }
852 };
853 #endif // TVM_IR_EXPR_H_
@ kTVMArgInt
Definition: c_runtime_api.h:175
@ kTVMNullptr
Definition: c_runtime_api.h:178
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Base type of all the expressions.
Definition: expr.h:50
static constexpr const char * _type_key
Definition: expr.h:58
static constexpr const bool _type_has_method_shash_reduce
Definition: expr.h:60
static constexpr const uint32_t _type_child_slots
Definition: expr.h:61
TVM_DECLARE_BASE_OBJECT_INFO(BaseExprNode, Object)
static constexpr const bool _type_has_method_sequal_reduce
Definition: expr.h:59
Span span
Span that points to the original source code. Reserved debug information.
Definition: expr.h:56
Managed reference to BaseExprNode.
Definition: expr.h:69
TVM_DEFINE_OBJECT_REF_METHODS(BaseExpr, ObjectRef, BaseExprNode)
Boolean constant.
Definition: expr.h:597
Bool operator!() const
Definition: expr.h:600
Bool(bool value, Span span=Span())
Definition: expr.h:599
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(Bool, IntImm, IntImmNode)
Constant floating point literals in the program.
Definition: expr.h:548
bool SEqualReduce(const FloatImmNode *other, SEqualReducer equal) const
Definition: expr.h:559
TVM_DECLARE_FINAL_OBJECT_INFO(FloatImmNode, PrimExprNode)
void VisitAttrs(AttrVisitor *v)
Definition: expr.h:553
double value
The constant value content.
Definition: expr.h:551
static constexpr const char * _type_key
Definition: expr.h:568
void SHashReduce(SHashReducer hash_reduce) const
Definition: expr.h:563
Managed reference class to FloatImmNode.
Definition: expr.h:577
TVM_DEFINE_OBJECT_REF_COW_METHOD(FloatImmNode)
TVM_DEFINE_OBJECT_REF_METHODS(FloatImm, PrimExpr, FloatImmNode)
FloatImm(DataType dtype, double value, Span span=Span())
Constructor.
Global variable that lives in the top-level module.
Definition: expr.h:456
TVM_DECLARE_FINAL_OBJECT_INFO(GlobalVarNode, RelayExprNode)
void SHashReduce(SHashReducer hash_reduce) const
Definition: expr.h:474
void VisitAttrs(AttrVisitor *v)
Definition: expr.h:461
static constexpr const char * _type_key
Definition: expr.h:479
String name_hint
The name of the variable, this only acts as a hint.
Definition: expr.h:459
bool SEqualReduce(const GlobalVarNode *other, SEqualReducer equal) const
Definition: expr.h:469
Managed reference to GlobalVarNode.
Definition: expr.h:487
GlobalVar(String name_hint, Type type={}, Span span={})
TVM_DEFINE_OBJECT_REF_METHODS(GlobalVar, RelayExpr, GlobalVarNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(GlobalVarNode)
Constant integer literals in the program.
Definition: expr.h:501
TVM_DECLARE_FINAL_OBJECT_INFO(IntImmNode, PrimExprNode)
void VisitAttrs(AttrVisitor *v)
Definition: expr.h:506
static constexpr const char * _type_key
Definition: expr.h:521
int64_t value
the Internal value.
Definition: expr.h:504
void SHashReduce(SHashReducer hash_reduce) const
Definition: expr.h:516
bool SEqualReduce(const IntImmNode *other, SEqualReducer equal) const
Definition: expr.h:512
Managed reference class to IntImmNode.
Definition: expr.h:530
TVM_DEFINE_OBJECT_REF_COW_METHOD(IntImmNode)
TVM_DEFINE_OBJECT_REF_METHODS(IntImm, PrimExpr, IntImmNode)
IntImm(DataType dtype, int64_t value, Span span=Span())
Constructor.
Container of constant int that adds more constructors.
Definition: expr.h:632
Bool operator!=(Enum other) const
Definition: expr.h:684
Integer(ObjectPtr< Object > node)
constructor from node.
Definition: expr.h:638
Integer()
Definition: expr.h:634
Bool operator!=(int other) const
Definition: expr.h:678
Integer(Enum value)
Constructor from enum.
Definition: expr.h:654
Bool operator==(int other) const
Definition: expr.h:674
Integer(IntImm other)
Construct integer from int imm.
Definition: expr.h:647
int64_t IntValue() const
convert to int64_t
Definition: expr.h:669
Bool operator==(Enum other) const
Definition: expr.h:680
Integer & operator=(const IntImm &other)
Assign an expression to integer.
Definition: expr.h:662
Integer(int value, Span span=Span())
Construct integer from int value.
Definition: expr.h:642
Base node of all primitive expressions.
Definition: expr.h:86
static constexpr const uint32_t _type_child_slots
Definition: expr.h:107
TVM_OBJECT_ENABLE_SCRIPT_PRINTER()
DataType dtype
The runtime data type of the primitive expression.
Definition: expr.h:102
static constexpr const char * _type_key
Definition: expr.h:106
TVM_DECLARE_BASE_OBJECT_INFO(PrimExprNode, BaseExprNode)
Reference to PrimExprNode.
Definition: expr.h:115
DataType dtype() const
Definition: expr.h:129
TVM_DEFINE_OBJECT_REF_METHODS(PrimExpr, BaseExpr, PrimExprNode)
PrimExpr(float value)
construct from float.
PrimExpr(int32_t value)
construct from integer.
range over one dimension
Definition: expr.h:690
PrimExpr min
beginning of the node
Definition: expr.h:693
void VisitAttrs(AttrVisitor *v)
Definition: expr.h:703
RangeNode(PrimExpr min, PrimExpr extent, Span span=Span())
Definition: expr.h:700
bool SEqualReduce(const RangeNode *other, SEqualReducer equal) const
Definition: expr.h:709
static constexpr const char * _type_key
Definition: expr.h:718
void SHashReduce(SHashReducer hash_reduce) const
Definition: expr.h:713
TVM_DECLARE_FINAL_OBJECT_INFO(RangeNode, Object)
RangeNode()
constructor
Definition: expr.h:699
static constexpr const bool _type_has_method_shash_reduce
Definition: expr.h:720
PrimExpr extent
the extend of range
Definition: expr.h:695
static constexpr const bool _type_has_method_sequal_reduce
Definition: expr.h:719
Span span
the location of this range in the source
Definition: expr.h:697
Range container
Definition: expr.h:725
static Range FromMinExtent(PrimExpr min, PrimExpr extent, Span span=Span())
construct a new range with min and extent The corresponding constructor is removed,...
Range(PrimExpr begin, PrimExpr end, Span span=Span())
constructor by begin and end
TVM_DEFINE_OBJECT_REF_METHODS(Range, ObjectRef, RangeNode)
Base node of all non-primitive expressions.
Definition: expr.h:362
TVM_DECLARE_BASE_OBJECT_INFO(RelayExprNode, BaseExprNode)
const TTypeNode * type_as() const
Check if the inferred(checked) type of the Expr is backed by a TTypeNode and return it.
Definition: expr.h:758
VirtualDevice virtual_device() const
const Type & checked_type() const
Definition: expr.h:750
ObjectRef virtual_device_
The virtual device (VirtualDevice) for this node (the result of device planning). For first-order exp...
Definition: expr.h:418
Optional< ObjectRef > struct_info_
Stores the result of structure information of the expression that encapsulate both static shape and r...
Definition: expr.h:377
Type checked_type_
Stores the result of type inference(type checking).
Definition: expr.h:370
static constexpr const char * _type_key
Definition: expr.h:433
static constexpr const uint32_t _type_child_slots
Definition: expr.h:434
Managed reference to RelayExprNode.
Definition: expr.h:442
TVM_DEFINE_OBJECT_REF_METHODS(RelayExpr, BaseExpr, RelayExprNode)
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:126
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:110
void FreeVarHashImpl(const runtime::Object *var) const
Implementation for hash for a free var.
Definition: structural_hash.h:192
Definition: source_map.h:120
Managed reference to TypeNode.
Definition: type.h:93
Managed reference class to VirtualDeviceNode.
Definition: virtual_device.h:271
Runtime primitive data type.
Definition: data_type.h:43
static DataType Float(int bits, int lanes=1)
Construct an float type.
Definition: data_type.h:234
static DataType Int(int bits, int lanes=1)
Construct an int type.
Definition: data_type.h:217
A custom smart pointer for Object.
Definition: object.h:362
Base class of all object reference.
Definition: object.h:519
bool defined() const
Definition: object.h:552
const Object * get() const
Definition: object.h:554
ObjectPtr< Object > data_
Internal pointer that backs the reference.
Definition: object.h:605
const ObjectType * as() const
Try to downcast the internal Object to a raw pointer of a corresponding type.
Definition: object.h:906
base class of all object containers.
Definition: object.h:171
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reference to string objects.
Definition: string.h:98
Internal base class to handle conversion to POD values.
Definition: packed_func.h:552
TObjectRef AsObjectRef() const
Definition: packed_func.h:2016
int type_code() const
Definition: packed_func.h:621
IR/AST nodes for the unified type system in TVM.
tvm::Type Type
Definition: type.h:47
tvm::Span Span
Definition: base.h:65
Var var(std::string name_hint, DataType t=DataType::Int(32))
Construct a new Var expression.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
PrimExpr operator!=(PrimExpr a, PrimExpr b)
not_equal
PrimExpr max(PrimExpr a, PrimExpr b, Span span=Span())
take maximum of two values
PrimExpr operator/(PrimExpr a, PrimExpr b)
division operator
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
PrimExpr operator>>(PrimExpr a, PrimExpr b)
right shift operator
PrimExpr operator<(PrimExpr a, PrimExpr b)
less
PrimExpr operator|(PrimExpr a, PrimExpr b)
take bitwise or of two values
PrimExpr operator==(PrimExpr a, PrimExpr b)
equal
PrimExpr operator~(PrimExpr a)
take bitwise negation of two values
PrimExpr operator>=(PrimExpr a, PrimExpr b)
greater_equal
PrimExpr operator<=(PrimExpr a, PrimExpr b)
less_equal
PrimExpr operator*(PrimExpr a, PrimExpr b)
multiplication operator
PrimExpr operator&(PrimExpr a, PrimExpr b)
take bitwise and of two values
PrimExpr min(PrimExpr a, PrimExpr b, Span span=Span())
take minimum of two values
PrimExpr operator!(PrimExpr a)
not
PrimExpr operator^(PrimExpr a, PrimExpr b)
take bitwise xor of two values
PrimExpr operator-(PrimExpr a, PrimExpr b)
subtraction operator
PrimExpr operator||(PrimExpr a, PrimExpr b)
or
PrimExpr operator>(PrimExpr a, PrimExpr b)
greater
PrimExpr operator+(PrimExpr a, PrimExpr b)
add operator
PrimExpr operator<<(PrimExpr a, PrimExpr b)
left shift operator
PrimExpr operator&&(PrimExpr a, PrimExpr b)
and
Definitions and helper macros for IR/AST nodes.
A managed object in the TVM runtime.
A map from source names to source code.
Runtime String container types.
ObjectRef equal functor.
Definition: object.h:665
ObjectRef hash functor.
Definition: object.h:655
static PrimExpr From(const TVMPODValue_ &val)
Definition: expr.h:776
static tvm::Bool From(const TVMPODValue_ &val)
Definition: expr.h:810
static tvm::Integer From(const TVMPODValue_ &val)
Definition: expr.h:797
Type trait to specify special value conversion rules from TVMArgValue and TVMRetValue.
Definition: packed_func.h:1104