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

Class ShapeProxy

python/tvm/relax/script/parser/entry.py:407–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405
406
407class ShapeProxy(StructInfoProxy):
408 values: list[PrimExpr] | None
409 ndim: int
410 """The type of shape values.
411
412 Parameters
413 ----------
414 values : Optional[List[PrimExpr]]
415 The symbolic shape values if known.
416
417 ndim : Optional[int]
418 The size of the shape.
419 """
420
421 def __init__(
422 self,
423 values: list[PrimExpr] | None = None,
424 ndim: int = -1,
425 ) -> None:
426 self.values = values
427 self.ndim = ndim
428
429 def get_symbolic_vars(self) -> set[str]:
430 if self.values is None:
431 return set()
432 else:
433 return {v for v in self.values if isinstance(v, str) and v.isidentifier()}
434
435 def as_struct_info(self, dict_globals: dict[str, Any] | None = None) -> ShapeStructInfo:
436 values = [_eval_shape(v, dict_globals) for v in self.values] if self.values else None
437 return ShapeStructInfo(values, self.ndim)
438
439
440def Shape(values: list[PrimExpr] | None = None, ndim: int = -1) -> ShapeProxy:

Callers 1

ShapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…