Expand description
The regular float
Structs§
- Tensor
- Tensor, can own, or borrow the underlying tensor
Functions§
- add
- tensor elementwise addition. b += a. a is automatically broadcasted.
- apply
- Applies
functo every item of the tensor - causal_
softmax - Causal softmax on the last dimension for tensor
x. The causality is determined by the shape ofxandpast_sequence_lengthwhich defines how big is the missing part of the square. - faster_
gelu geluoperation https://en.wikipedia.org/wiki/Activation_function#Comparison_of_activation_functions but using faster_tanh- faster_
tanh - utility function to use a faster but less precise tanh
- gelu
geluoperation https://en.wikipedia.org/wiki/Activation_function#Comparison_of_activation_functions- inline_
tanh - utility function to use a faster but less precise tanh
- matmul
- Regular matrix multiplication
- matmul_
t - Matrix multiplication matmul(A, B.transposed())
- mul
- tensor elementwise multiplication. b *= a. a is automatically broadcasted.
- normalize
- Basic operation for the layernorm.
x = (x - x.mean()) / (x.var() + epsilon)
meanandvardo not have to be initialized, they are simply passed to avoid allocation. - select
- Operation for selecting entire rows within tensor
weights. Eachidis the index of the row. - softmax
- Softmax on the last dimension for tensor
x - special_
argmax - Argmax of the last dimension of tensor
x.