deeplake.util.shape_interval¶
-
class
deeplake.util.shape_interval.ShapeInterval¶ -
__init__(lower: Sequence[int], upper: Optional[Sequence[int]] = None)¶ Shapes in Deep Lake are best represented as intervals, this is to support dynamic tensors. Instead of having a single tuple of integers representing shape, we use 2 tuples of integers to represent the lower and upper bounds of the representing shape.
- If
lower == upperfor all cases, the shape is considered “fixed”. - If
lower != upperfor any cases, the shape is considered “dynamic”.
Parameters: - lower (sequence) – Sequence of integers that represent the lower-bound shape.
- upper (sequence) – Sequence of integers that represent the upper-bound shape. If None is provided, lower is used as upper (implicitly fixed-shape).
Raises: InvalidShapeIntervalError– If the provided lower/upper bounds are incompatible to represent a shape.- If
-