Class AccessPathObj#

Inheritance Relationships#

Base Type#

Class Documentation#

class AccessPathObj : public tvm::ffi::Object#

ObjectRef class of AccessPathObj.

See also

AccessPathObj

Public Functions

AccessPathObj() = default#
inline AccessPathObj(Optional<ObjectRef> parent, Optional<AccessStep> step, int32_t depth)#

Constructor for the access path.

Parameters:
  • parent – The parent of the access path.

  • step – The current step of the access path.

  • depth – The current depth of the access path.

inline Optional<AccessPath> GetParent() const#

Get the parent of the access path.

Returns:

The parent of the access path.

inline AccessPath Extend(AccessStep step) const#

Extend the access path with a new step.

Parameters:

step – The step to extend the access path with.

Returns:

The extended access path.

inline AccessPath Attr(String field_name) const#

Extend the access path with an object attribute access.

Parameters:

field_name – The name of the field to access.

Returns:

The extended access path.

inline AccessPath AttrMissing(String field_name) const#

Extend the access path with an object attribute missing access.

Parameters:

field_name – The name of the field to access.

Returns:

The extended access path.

inline AccessPath ArrayItem(int64_t index) const#

Extend the access path with an array item access.

Parameters:

index – The index of the array item to access.

Returns:

The extended access path.

inline AccessPath ArrayItemMissing(int64_t index) const#

Extend the access path with an array item missing access.

Parameters:

index – The index of the array item to access.

Returns:

The extended access path.

inline AccessPath MapItem(Any key) const#

Extend the access path with a map item access.

Parameters:

key – The key of the map item to access.

Returns:

The extended access path.

inline AccessPath MapItemMissing(Any key) const#

Extend the access path with a map item missing access.

Parameters:

key – The key of the map item to access.

Returns:

The extended access path.

inline Array<AccessStep> ToSteps() const#

Get the array of steps that corresponds to the access path.

Returns:

The array of steps that corresponds to the access path.

inline bool PathEqual(const AccessPath &other) const#

Check if two paths are equal by deep comparing the steps.

Parameters:

other – The other path to compare with.

Returns:

True if the two paths are equal, false otherwise.

inline bool IsPrefixOf(const AccessPath &other) const#

Check if this path is a prefix of another path.

Parameters:

other – The other path to compare with.

Returns:

True if this path is a prefix of the other path, false otherwise.

Public Members

Optional<ObjectRef> parent#

The parent of the access path.

This parent-pointing tree structure is more space efficient when representing multiple paths that share a common prefix.

Note

Empty for root.

Optional<AccessStep> step#

The current of the access path.

Note

Empty for root.

int32_t depth#

The current depth of the access path, 0 for root.