Functions that operate on tensors
embedding
embedding (input:tidygrad.tensor.Tensor, indices, name=None)
dropout
dropout (x:tidygrad.tensor.Tensor, p=0.5, training=True)
Apply Dropout to a tensor
transpose
transpose (a:tidygrad.tensor.Tensor, dim0, dim1, name=None)
Transpose a tensor
slice
slice (a:tidygrad.tensor.Tensor, key, name=None)
broadcast
broadcast (a:tidygrad.tensor.Tensor, target_shape, name=None)
Broadcast a tensor to the given shape
sum
sum (a:tidygrad.tensor.Tensor, name=None, axis=None, keepdims=False)
Sum-reduce a tensor along the given axis (int or tuple of ints)
matmul
matmul (a:tidygrad.tensor.Tensor, b:tidygrad.tensor.Tensor, name=None)
Matrix multiplication of two tensors
logexp
logexp (a:tidygrad.tensor.Tensor, name=None)
Exponentiate a tensor
exp
exp (a:tidygrad.tensor.Tensor, name=None)
Exponentiate a tensor
log
log (a:tidygrad.tensor.Tensor, name=None)
Take the natural logarithm of a tensor
pow
pow (a:tidygrad.tensor.Tensor, power:tidygrad.tensor.Tensor, name=None)
Raise a tensor to a power (a**power)
neg
neg (a:tidygrad.tensor.Tensor, name=None)
Negate a tensor (-a)
div
div (a:tidygrad.tensor.Tensor, b:tidygrad.tensor.Tensor, name=None)
Divide two tensors (a/b)
mul
mul (a:tidygrad.tensor.Tensor, b:tidygrad.tensor.Tensor, name=None)
Multiply two tensors
sub
sub (a:tidygrad.tensor.Tensor, b:tidygrad.tensor.Tensor, name=None)
Subtract two tensors
add
add (a:tidygrad.tensor.Tensor, b:tidygrad.tensor.Tensor, name=None)
Add two tensors
relu
relu (input:tidygrad.tensor.Tensor, name=None)
tanh
tanh (input:tidygrad.tensor.Tensor, name=None)
sigmoid
sigmoid (input:tidygrad.tensor.Tensor, name=None)
gelu
gelu (input:tidygrad.tensor.Tensor)
sigmoid_gelu
sigmoid_gelu (x:tidygrad.tensor.Tensor)
softmax
softmax (input:tidygrad.tensor.Tensor, name=None)
layer_norm
layer_norm (x:tidygrad.tensor.Tensor, w:tidygrad.tensor.Tensor, b:tidygrad.tensor.Tensor, eps=1e-05)
concat
concat (tensors:list[tidygrad.tensor.Tensor], axis=0, name=None)
stack
stack (tensors:list[tidygrad.tensor.Tensor], axis=0, name=None)
BCE_loss
BCE_loss (logits:tidygrad.tensor.Tensor, target:tidygrad.tensor.Tensor, reduction='mean')
CrossEntropy_loss
CrossEntropy_loss (logits:tidygrad.tensor.Tensor, target:tidygrad.tensor.Tensor, reduction='mean')