MCPcopy Create free account
hub / github.com/apache/tvm / with_struct_info

Method with_struct_info

python/tvm/relax/expr_functor.py:1524–1541  ·  view source on GitHub ↗

Create a new var with specified shape and type if the original var's shape or type does not match with the specified ones. Parameters ---------- var : Var The var to be updated. struct_info : StructInfo The struct info. Return

(self, var: Var, struct_info: StructInfo)

Source from the content-addressed store, hash-verified

1522 return _ffi_api.PyExprMutatorLookupBinding(self._outer(), var) # type: ignore
1523
1524 def with_struct_info(self, var: Var, struct_info: StructInfo) -> Var:
1525 """Create a new var with specified shape and type if the original var's shape or type does
1526 not match with the specified ones.
1527
1528 Parameters
1529 ----------
1530 var : Var
1531 The var to be updated.
1532 struct_info : StructInfo
1533 The struct info.
1534
1535 Returns
1536 -------
1537 var : Var
1538 The var filled with shape and type.
1539 """
1540 # Using self._outer() to ref _PyExprMutator
1541 return _ffi_api.PyExprMutatorWithStructInfo(self._outer(), var, struct_info) # type: ignore

Callers 2

visit_var_binding_Method · 0.80
visit_match_cast_Method · 0.80

Calls

no outgoing calls

Tested by 2

visit_var_binding_Method · 0.64
visit_match_cast_Method · 0.64