24 #ifndef TVM_RUNTIME_CONTAINER_BOXED_PRIMITIVE_H_
25 #define TVM_RUNTIME_CONTAINER_BOXED_PRIMITIVE_H_
58 template <
typename Prim>
59 struct BoxNodeRuntimeTraits;
63 template <
typename Prim>
75 static constexpr
const char*
_type_key = detail::BoxNodeRuntimeTraits<Prim>::_type_key;
80 template <
typename Prim>
89 operator Prim()
const {
return (*this)->value; }
125 struct BoxNodeRuntimeTraits<int64_t> {
126 static constexpr
const char* _type_key =
"runtime.BoxInt";
130 struct BoxNodeRuntimeTraits<double> {
131 static constexpr
const char* _type_key =
"runtime.BoxFloat";
135 struct BoxNodeRuntimeTraits<bool> {
136 static constexpr
const char* _type_key =
"runtime.BoxBool";
Definition: boxed_primitive.h:64
static constexpr bool _type_has_method_visit_attrs
Definition: boxed_primitive.h:76
TVM_DECLARE_FINAL_OBJECT_INFO(BoxNode, Object)
BoxNode(Prim value)
Constructor.
Definition: boxed_primitive.h:70
static constexpr const char * _type_key
Definition: boxed_primitive.h:75
Prim value
The boxed value.
Definition: boxed_primitive.h:73
Definition: boxed_primitive.h:81
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(Box, ObjectRef, BoxNode< Prim >)
Box(Prim value)
Constructor.
Definition: boxed_primitive.h:87
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
ObjectPtr< ArrayNode > make_object()
Definition: array.h:908
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
A managed object in the TVM runtime.
Runtime memory management.