(dims)
| 826 | ]), f"Expect all dimensions >=0, got {override_shape}" |
| 827 | |
| 828 | def volume_func(dims): |
| 829 | return reduce(lambda x, y: x * y, dims, 1) |
| 830 | assert volume_func(override_shape) <= volume_func(torch_shape), \ |
| 831 | f"Override the shape to be larger than the underlying torch Tensor, got {override_shape}, torch tensor shape {torch_shape}" |
| 832 | else: |