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
| 140 | |
| 141 | @tvm_ffi.register_object("relax.TensorStructInfo") |
| 142 | class 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") |
no outgoing calls
searching dependent graphs…