boundlab.linearop.ExpandOp#
- class boundlab.linearop.ExpandOp[source]#
Bases:
objectBroadcast-expand dimensions.
Implemented as an EinsumOp with a ones template tensor. When
len(input_shape) < len(output_shape), leading size-1 dims are prepended to input_shape automatically.Uses
torch.tensor(1.0).expand(output_shape)as the einsum tensor to save memory (stride-zero storage).Methods
__init__