26 #ifndef TVM_NODE_OBJECT_PATH_H_ 27 #define TVM_NODE_OBJECT_PATH_H_ 37 using runtime::Object;
38 using runtime::ObjectPtr;
39 using runtime::ObjectRef;
162 static constexpr
const char* _type_key =
"AttributeAccessPath";
182 static constexpr
const char* _type_key =
"UnknownAttributeAccessPath";
205 static constexpr
const char* _type_key =
"ArrayIndexPath";
227 static constexpr
const char* _type_key =
"MissingArrayElementPath";
250 static constexpr
const char* _type_key =
"MapValuePath";
269 static constexpr
const char* _type_key =
"MissingMapEntryPath";
285 #endif // TVM_NODE_OBJECT_PATH_H_ String attr_key
Name of the attribute being accessed. Must be a static string.
Definition: object_path.h:158
int32_t index
Index of the array element that is missing.
Definition: object_path.h:223
Optional< ObjectPath > GetParent() const
Get the parent path.
Runtime Optional container types.
ObjectPath MissingArrayElement(int32_t index) const
Extend this path with access to a missing array element.
Runtime String container types.
Definition: object_path.h:148
Definition: object_path.h:243
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
bool PathsEqual(const ObjectPath &other) const
Check if two paths are equal.
ObjectRef key
Key of the map entry that is being accessed.
Definition: object_path.h:246
Definition: object_path.h:170
Definition: object_path.h:265
Definition: object_path.h:213
ObjectPath ArrayIndex(int32_t index) const
Extend this path with access to an array element.
Definition: object_path.h:258
base class of all object containers.
Definition: object.h:167
virtual bool LastNodeEqual(const ObjectPathNode *other) const =0
Definition: object_path.h:136
Definition: object_path.h:155
Definition: object_path.h:220
ObjectPath MissingMapEntry() const
Extend this path with access to a missing map entry.
friend std::string GetObjectPathRepr(const ObjectPathNode *node)
int32_t Length() const
Get the length of the path.
Path to an object from some root object.
Definition: object_path.h:55
ObjectPathNode(const ObjectPathNode *parent)
Definition: object_path.h:190
ObjectPath Attr(const char *attr_key) const
Extend this path with access to an object attribute.
Definition: object_path.h:235
Reference to string objects.
Definition: string.h:98
Definition: object_path.h:178
virtual std::string LastNodeString() const =0
Base class of all object reference.
Definition: object.h:511
Definition: object_path.h:277
int32_t index
Index of the array element that is being accessed.
Definition: object_path.h:201
static constexpr const char * _type_key
Definition: object_path.h:101
A managed object in the TVM runtime.
#define TVM_DECLARE_FINAL_OBJECT_INFO(TypeName, ParentType)
helper macro to declare type information in a final class.
Definition: object.h:671
Definition: object_path.h:122
ObjectPath MapValue(ObjectRef key) const
Extend this path with access to a map value.
TVM_DECLARE_BASE_OBJECT_INFO(ObjectPathNode, Object)
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Definition: object_path.h:198
bool IsPrefixOf(const ObjectPath &other) const
Check if this path is a prefix of another path.
#define TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:728
ObjectPath GetPrefix(int32_t length) const
Get a path prefix of the given length.
const ObjectPathNode * ParentNode() const