MCPcopy Create free account
hub / github.com/pytorch/executorch / determine_tensor_dynanism

Function determine_tensor_dynanism

exir/tensor.py:133–141  ·  view source on GitHub ↗
(shape: torch.Size)

Source from the content-addressed store, hash-verified

131
132
133def determine_tensor_dynanism(shape: torch.Size) -> TensorShapeDynamism:
134 if all(isinstance(s, int) for s in shape):
135 return TensorShapeDynamism.STATIC
136 else:
137 try:
138 _ = eval_shape(shape)
139 return TensorShapeDynamism.DYNAMIC_BOUND
140 except torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode:
141 return TensorShapeDynamism.DYNAMIC_UNBOUND
142
143
144ALIGNMENT = 16

Callers 2

__init__Method · 0.90
__init__Method · 0.85

Calls 1

eval_shapeFunction · 0.90

Tested by

no test coverage detected