mygrad.Tensor.creator#

property Tensor.creator: Operation | None#

The Operation instance that produced self.

Returns:
creatorOptional[Operation]

The operation-instance that created the tensor, or None.

Examples

>>> import mygrad as mg
>>> x = mg.Tensor(3)
>>> x.creator is None
True
>>> y = mg.Tensor(2)
>>> z = x * y  # Multiply(x, y) -> z
>>> z.creator
 <mygrad.math.arithmetic.ops.Multiply at 0x2df5a130438>