Box#
- class discopy.tensor.Box(name=None, dom=None, cod=None, data=None, *args, **kwargs)[source]#
Bases:
discopy.frobenius.Box
,Diagram
A tensor box is a frobenius box with an array as data.
- Parameters:
name – The name of the box.
dom (T) – The domain of the box, i.e. its input dimension.
cod (T) – The codomain of the box, i.e. its output dimension.
data – The array inside the tensor box.
Example
>>> b1 = Box('sauce_0', Dim(1), Dim(2), data=[0.84193562, 0.91343221]) >>> b1.eval() Tensor[float64]([0.84193562, 0.91343221], dom=Dim(1), cod=Dim(2))