(self, dict_globals: dict[str, Any] | None = None)
| 232 | return {s for s in self.shape if isinstance(s, str) and s.isidentifier()} |
| 233 | |
| 234 | def as_struct_info(self, dict_globals: dict[str, Any] | None = None) -> TensorStructInfo: |
| 235 | vdev = self.vdevice |
| 236 | if isinstance(self.vdevice, str): |
| 237 | if ":" in self.vdevice: |
| 238 | split_vdev = self.vdevice.split(":") |
| 239 | vdev = lookup_vdevice(split_vdev[0], int(split_vdev[1])) |
| 240 | else: |
| 241 | vdev = lookup_vdevice(self.vdevice, 0) |
| 242 | |
| 243 | if self.shape is None: |
| 244 | return TensorStructInfo(None, self.dtype, vdev, self.ndim) |
| 245 | elif isinstance(self.shape, ShapeExpr | Var): |
| 246 | return TensorStructInfo(self.shape, self.dtype, vdev, self.ndim) |
| 247 | else: |
| 248 | if dict_globals is None and any([isinstance(s, str) for s in self.shape]): |
| 249 | raise ValueError( |
| 250 | "String-defined shape expr is only allowed when parsing function parameters " |
| 251 | "and return annotations for TVMScript." |
| 252 | ) |
| 253 | shape = [_eval_shape(s, dict_globals) for s in self.shape] |
| 254 | return TensorStructInfo(shape, self.dtype, vdev, self.ndim) |
| 255 | |
| 256 | |
| 257 | def Tensor( |
nothing calls this directly
no test coverage detected