[math] Add BoundDim.size_or_1
@@ -464,6 +464,10 @@ class BoundDim:
""" Length of this dimension as listed in the `Shape` of the bound object. """
return self.obj.shape.get_size(self.name) if self.exists else None
+ @property
+ def size_or_1(self):
+ return self.obj.shape.get_size(self.name) if self.exists else 1
+
@property
def type(self) -> Callable:
"""
