Tensor.sparse_categorical_crossentropy()
Returns the sparse categorical crossentropy loss between two tensors.
Usage
from tinygrad.tensor import Tensor
a1 = Tensor([1, 2, 3])
a2 = Tensor([1, 2, 3])
a1 = a1.sparse_categorical_crossentropy(a2)
print(a1.numpy())
Return value
0.6050707