MCPcopy Index your code
hub / github.com/apache/tvm / TensorStructInfo

Class TensorStructInfo

python/tvm/relax/struct_info.py:142–187  ·  view source on GitHub ↗

StructInfo of a Tensor value. Parameters ---------- shape : Optional[Expr] The shape expression. dtype : Optional[str] The content data type. vdevice : Optional[Vdevice] The virtual device. ndim : Optional[int] The number of dimensions of the

Source from the content-addressed store, hash-verified

140
141@tvm_ffi.register_object("relax.TensorStructInfo")
142class TensorStructInfo(StructInfo):
143 """StructInfo of a Tensor value.
144
145 Parameters
146 ----------
147 shape : Optional[Expr]
148 The shape expression.
149
150 dtype : Optional[str]
151 The content data type.
152
153 vdevice : Optional[Vdevice]
154 The virtual device.
155
156 ndim : Optional[int]
157 The number of dimensions of the tensor.
158
159 Note
160 ----
161 Do not specify shape and ndim at the same time.
162 """
163
164 shape: Expr | None
165 dtype: str
166 vdevice: VDevice | None
167 ndim: int
168 span: Span
169
170 def __init__(
171 self,
172 shape: Expr | None | list[PrimExpr] = None,
173 dtype: str = "float32",
174 vdevice: VDevice | None | str = None,
175 ndim: int = -1,
176 span: Span = None,
177 ) -> None:
178 if isinstance(shape, list | tuple | Array):
179 shape = ShapeExpr(shape)
180 self.__init_handle_by_constructor__(
181 _ffi_api.TensorStructInfo,
182 shape,
183 dtype,
184 ndim,
185 vdevice,
186 span, # type: ignore
187 )
188
189
190@tvm_ffi.register_object("relax.TupleStructInfo")

Callers 11

as_struct_infoMethod · 0.90
_layout_transformFunction · 0.90
test_dtensor_struct_infoFunction · 0.90
gen_call_tir_inputsFunction · 0.85
placeholderMethod · 0.85
get_functionMethod · 0.85
get_functionMethod · 0.85
get_functionMethod · 0.85
_allgatherFunction · 0.85
_scatter_from_worker0Function · 0.85

Calls

no outgoing calls

Tested by 2

test_dtensor_struct_infoFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…