fn
is_same_size
→boolis_same_size(a: Tensor, b: Tensor)Predicate: do two tensors have identical shapes?
Compares the shape tuples exactly — no broadcasting compatibility is
implied. Use lucid.broadcast_shapes if broadcastability is
the question.
Parameters
aTensorFirst tensor.
bTensorSecond tensor.
Returns
boolTrue iff tuple(a.shape) == tuple(b.shape).
Notes
Compares all dimensions including singleton axes:
A (1, 3) tensor is not the same size as a (3,) tensor, even
though they broadcast.
Examples
>>> import lucid
>>> a = lucid.zeros(2, 3)
>>> b = lucid.ones(2, 3)
>>> lucid.is_same_size(a, b)
True