giagrad.Tensor.comm#
- classmethod Tensor.comm(function: Function, *tensors) Tensor [source]#
Returns a new instance of an autodifferentiable tensor given a
giagrad.tensor.Function
.comm
creates a tensor with the output offorward()
.For developer use.
- Parameters:
Examples
>>> from giagrad.mlops import Softmax >>> t = Tensor.empty(2, 3).uniform(-1, 1) >>> t tensor: [[ 0.27639335 0.7524293 0.69203097] [ 0.37772807 -0.9291505 -0.80418533]] >>> Tensor.comm(Softmax(axis=1), t) tensor: [[0.24242324 0.390224 0.36735278] [0.6339727 0.17159334 0.19443396]] fn: Softmax(axis=1)