MCPcopy Create free account

hub / github.com/TuckerBMorgan/can-t / functions

Functions825 in github.com/TuckerBMorgan/can-t

↓ 353 callersMethoditem
Returns the underlaying tensor as an Array
src/central/tensor.rs:307
↓ 237 callersMethodgrad
returns the underlaying grad of this tensor as an Array
src/central/tensor.rs:312
↓ 226 callersMethodset_requires_grad
Helper function to set the requires_grad bool, also sets the internal tensor as well
src/central/tensor.rs:347
↓ 184 callersMethodsum
(&self, mut axes: Vec<usize>, keep_dimensions: bool)
src/central/sum_op.rs:7
↓ 178 callersMethodbackward
sends this node backwards though the network, adding to the grad of every node that feeds into this one
src/central/tensor.rs:360
↓ 134 callersFunctionzero_all_grads
()
src/central/mod.rs:91
↓ 126 callersMethoddimensions
Returns the dimensions of the shape
src/central/shape.rs:67
↓ 66 callersFunctionget_equation
()
src/central/mod.rs:86
↓ 43 callersMethodmean
Computes the mean along specified axes # Arguments 'axes' - Vector of axis indices along which to compute the mean
src/central/mean_op.rs:8
↓ 40 callersMethodget_data_flat_buffer
Gets the underlaying backing storage of the tensor, util function for working with data of a tensor # Arguments 'tensor_id' - The tensor we are workin
src/central/equation.rs:349
↓ 35 callersMethodforward
(&mut self, inputs: Tensor)
src/nn/layer_norm.rs:37
↓ 35 callersMethodrelu
(&mut self)
src/central/relu_op.rs:4
↓ 33 callersMethodadd_tensor_grad
Adds new grad into the grad of tensor_id # Arugments 'tensor_id' - Id of for the loopup on the tensor 'grad' - the grad we are copying in
src/central/equation.rs:454
↓ 32 callersMethodreshape
Reshapes the underlaying tensor into a new shape it preforms a full copy under the hood
src/central/reshape.rs:6
↓ 30 callersMethodget_tensor_shape
Helper function to get the shape of a tensor, without getting the entire tensor # Arguments 'tensor_id' - the tensor you are getting the shape for
src/central/equation.rs:356
↓ 28 callersMethodtanh
Applies the hyperbolic tangent function element-wise to the tensor Returns a new tensor with the same shape where each element x is replaced with tanh
src/central/tanh_op.rs:8
↓ 27 callersMethodset_keep_alive
Helper function to set the keep_alive bool, also sets the internal tensor as well
src/central/tensor.rs:354
↓ 26 callersMethodtranspose
Swaps two provides axis for a tensor # Arguments 'first_index' : first index we are swapping 'second_index' : second index we are swapping
src/central/transpose_op.rs:53
↓ 24 callersFunctionapprox_eq
(a: &[f32], b: &[f32], eps: f32)
src/central/topk_op.rs:222
↓ 24 callersMethodforward
(&mut self, inputs: Tensor)
src/nn/linear.rs:61
↓ 24 callersMethodget_grad_flat_buffer
Gets the underlaying backing storage of the tensor, util function for working with grad of a tensor # Arguments 'tensor_id' - The tensor we are workin
src/central/equation.rs:342
↓ 23 callersMethodmasked_fill
(&self, mask: Tensor, value: f32)
src/central/masked_fill.rs:4
↓ 23 callersMethodpow
returns a tensors with each element raised to the provided power arguments 'power' - the power we are will raise each element to
src/central/pow_op.rs:7
↓ 22 callersMethodsoftmax
Computes the softmax function along specified axis # Arguments `axis` - Axis along which to compute the softmax
src/central/softmax_op.rs:57
↓ 20 callersMethodstd
Computes the standard deviation along specified axes # Arguments 'axes' - Vector of axis indices along which to compute the standard deviation
src/central/std_op.rs:8
↓ 18 callersMethodlog
Returns the natural log(ln, not log10) of each element it uses natural log because that is what pytorch does when you call .log on a tensor
src/central/log.rs:6
↓ 18 callersMethodselect
(&self, indices_id: TensorID)
src/central/select_op.rs:6
↓ 18 callersMethodtotal_size
Returns the total number of elements in this shape
src/central/shape.rs:56
↓ 17 callersMethodforward
(&mut self, inputs: Tensor)
src/nn/embedding.rs:24
↓ 17 callersMethodgather
(&self, dimension: usize, index: Tensor)
src/central/gather_op.rs:28
↓ 16 callersFunctioncompare_tensors
(a: Tensor, b: Tensor)
src/central/matmul_op.rs:150
↓ 16 callersMethodmax
(&self, dimension: usize, keep_dim: bool)
src/central/max_op.rs:8
↓ 15 callersMethodforward
(&mut self, inputs: Tensor)
src/nn/multihead_attention.rs:161
↓ 15 callersMethodforward
(&mut self, input: Tensor)
src/nn/tanh.rs:13
↓ 15 callersFunctionread
(id: TensorID)
src/central/topk_op.rs:384
↓ 14 callersMethodget_grad
Returns the underlaying grad of a tensor, as an array # Arugments 'id' - Id for lookup of the tensor
src/central/equation.rs:330
↓ 13 callersMethodbroadcast
Broadcasts two tensors togethers to form a new broadcast shape # Aruguments 'shape' - The shape we want to broadcast to
src/central/tensor.rs:319
↓ 13 callersMethodforward
(&mut self, inputs: Tensor)
src/nn/gpt_block.rs:96
↓ 13 callersMethodmatmul_shape
Returns a new shape that would be the result of two matrices of the provided shapes being matmul together # Arguments 'other' - the shape of ther righ
src/central/shape.rs:244
↓ 13 callersMethodnumber_of_dimension
Returns the number of dimenions of the shape
src/central/shape.rs:51
↓ 12 callersMethodtopk
( &self, k: usize, dimension: usize, _largest: bool, _sorted: bool,
src/central/topk_op.rs:87
↓ 11 callersMethodstack
(&self, others: Vec<Tensor>, dimension: usize)
src/central/stack_op.rs:6
↓ 10 callersMethodforward
( &self, query: Tensor, key: Tensor, value: Tensor, mask: Option<Tenso
src/nn/scaled_dot_project_attention.rs:19
↓ 10 callersMethodforward
(&mut self, input: Tensor)
src/nn/sequential.rs:16
↓ 10 callersMethodget_item
Returns the underlaying data of a tensor, as an array # Arugments 'id' - Id for lookup of the tensor
src/central/equation.rs:318
↓ 10 callersFunctiontensor_from
(data: Vec<f32>, dims: &[usize])
src/central/topk_op.rs:379
↓ 10 callersMethodunsqueeze
adds a dimension of 1 at the provided dimensions
src/central/shape.rs:443
↓ 10 callersFunctionupdate_parameters
(learning_rate: f32)
src/central/mod.rs:96
↓ 9 callersMethodas_ndarray_shape
Returns the cant lib shape type in the right format to passed to an ndarray ArrayD
src/central/shape.rs:424
↓ 9 callersMethodset_index
(&self, index: Indexable, new_data: f32)
src/central/index.rs:27
↓ 8 callersMethodcos
Applies the cosine function element-wise to the tensor Returns a new tensor with the same shape where each element x is replaced with cos(x)
src/central/cos_op.rs:8
↓ 8 callersMethoddiagonal
Interesting things I have noticed first and second dimensions seem to end up being sorted and have to be unique
src/central/diagonal_op.rs:6
↓ 8 callersFunctionpadding_dimenions_to_max
(in_dimension: Vec<usize>)
src/utils/mod.rs:42
↓ 8 callersMethodsigmoid
Applies the sigmoid function element-wise to the tensor Returns a new tensor with the same shape where each element x is replaced with sigmoid(x)
src/central/sigmoid_op.rs:10
↓ 8 callersMethodsin
Applies the sin function element-wise to the tensor Returns a new tensor with the same shape where each element x is replaced with sin(x)
src/central/sin_op.rs:8
↓ 7 callersMethodclamp
clamps each element of the tensor between min and max It does this into a new tensor, not in place
src/central/clamp_op.rs:6
↓ 7 callersMethodl1_loss
Computes the element-wise L1 loss (mean absolute error) between two tensors. All dimensions are reduced so the return value is a scalar loss.
src/central/l1_loss.rs:6
↓ 6 callersFunctionassert_softmax_properties
(tensor: &Tensor, _axis: usize)
src/central/softmax_op.rs:115
↓ 6 callersMethodcat
(&self, other: Tensor, dimension: usize)
src/central/cat_op.rs:6
↓ 5 callersMethodallocate_tensor
Allocates a tensor, and returns the ID of it, so it can be looked up later # Arguments 'shape' - the shape of the tensor. shape.total_size * 2 memory
src/central/equation.rs:81
↓ 5 callersMethodapply_rotary_embedding
(&self, input: Tensor, cos: Tensor, sin: Tensor)
src/nn/rotary_embedding.rs:114
↓ 5 callersMethoddetach
(&self)
src/central/tensor.rs:169
↓ 5 callersMethodgarbage_collect
(&mut self)
src/central/equation.rs:920
↓ 5 callersMethodget_parameters
(&self)
src/nn/gpt_block.rs:125
↓ 5 callersMethodmovedim
Moves the dimension at `original_location` to `new_destination`.
src/central/movedim_op.rs:19
↓ 5 callersMethodremove_index
Returns a new shape with the dimension at the provided index removed # Arguments 'index' - The 0base index to be removed from the shape
src/central/shape.rs:79
↓ 4 callersMethodadd_dimension_at_index
Returns a new shape with the provided dimension added at the provided index # Arguments 'dimension' - the dimension to be inserted 'index' - the 0base
src/central/shape.rs:161
↓ 4 callersMethodcompact_tensor_store
(&mut self)
src/central/equation.rs:886
↓ 4 callersMethodget_value
(&self, name: impl AsRef<str>)
src/utils/gguf.rs:19
↓ 4 callersFunctionlinear_index
(point: &[usize], dims: &[usize])
src/central/gather_op.rs:4
↓ 4 callersMethodmul_vector
Takes two tensors as flat buffers, multiplies them together at an elementwise level and returns the result # Arguments 'a' : The first tensor 'b' : th
src/central/equation.rs:309
↓ 4 callersMethodpermute
Reorders the tensor axes according to the provided permutation.
src/central/permute.rs:73
↓ 4 callersMethodpermute
Returns a new shape where the existing dimensions are rearranged according to the order set in permutation # Arguments 'premutation' - The order the
src/central/shape.rs:114
↓ 4 callersFunctionpermute_flat_data
(data: &[f32], dims: &[usize], permutation: &[usize])
src/central/permute.rs:20
↓ 4 callersMethodset_is_grequires_grad
Helper function for setting the internal tensor to know if it needs gradient or not # Arguments 'tensor_id' : which Tensor we are setting 'requires_gr
src/central/equation.rs:845
↓ 3 callersMethodbroadcast_shape
Returns the shape of that results from two shapes being brodcasted # Arguments 'other' - The shape we are testing against
src/central/shape.rs:382
↓ 3 callersFunctionbuild_batch_norm_dataset_from_subset
( words: &[String], stoi: &HashMap<char, usize>, )
src/lib.rs:120
↓ 3 callersMethodchunk
(&self, dimensions: usize, chunks: usize)
src/central/chunk_op.rs:7
↓ 3 callersFunctioncompare_tensors
(a: Tensor, b: Tensor)
src/central/pow_op.rs:49
↓ 3 callersMethodcompute_cos_sin
Placeholder for gathering per-position cosine/sine slices.
src/nn/rotary_embedding.rs:105
↓ 3 callersMethodcross_entropy_loss
Computes cross-entropy loss between logits and targets # Arguments 'targets' - One-hot encoded target tensor with same shape as logits
src/central/cross_entropy_op.rs:7
↓ 3 callersMethodexp
Each element is returned as e ^ x
src/central/tensor.rs:369
↓ 3 callersMethodforward
(&mut self, input: Tensor)
src/nn/gpt2.rs:133
↓ 3 callersMethodforward
(&mut self, inputs: Tensor)
src/nn/rmsnorm.rs:20
↓ 3 callersFunctionhandle_broadcasting
Handles broadcasting two operands to the right size, was doing this in a few places, put it into a util function Arugments lhs* - the left hand opeara
src/utils/mod.rs:17
↓ 3 callersFunctionreference_rmsnorm
(sample: &[f32], scale: &[f32])
src/nn/rmsnorm.rs:55
↓ 2 callersMethodallocate_zero_tensor
Allocates a tensor, and returns the ID of it, so it can be looked up later, is all zeroes # Arguments 'shape' - the shape of the tensor. shape.total_s
src/central/equation.rs:117
↓ 2 callersFunctionbuild_move_permutation
(origin: usize, destination: usize, rank: usize)
src/central/movedim_op.rs:4
↓ 2 callersMethodcan_broadcast
Checks if the two shapes are broadcastable # Arguments 'other' - The shape we are testing against
src/central/shape.rs:354
↓ 2 callersFunctioncausal_mask
(seq_len: usize)
src/nn/gpt_block.rs:5
↓ 2 callersFunctioncompare_tensors
(a: Tensor, b: Tensor)
src/central/reshape.rs:43
↓ 2 callersFunctioncompute_strides
(dims: &[usize])
src/central/permute.rs:6
↓ 2 callersFunctionfirst_image_from_array2
(arr: &ArrayD<f32>)
examples/autoencoder.rs:238
↓ 2 callersMethodgenerate_all_positions
(&self)
src/central/shape.rs:465
↓ 2 callersMethodget_parameters
(&self)
src/nn/linear.rs:69
↓ 2 callersMethodget_parameters
(&self)
src/nn/sequential.rs:24
↓ 2 callersFunctionimage_to_ascii
(image: &[f32])
examples/autoencoder.rs:220
↓ 2 callersFunctioninvert_permutation
(permutation: &[usize])
src/central/permute.rs:59
↓ 2 callersMethodlength
(&self)
src/utils/data_set.rs:69
↓ 2 callersMethodmatmul_vector
takes two matrices as flat vectors and preforms matmul of them 'a' - the flat array of the first matrix 'a_shape' - the shape of a 'b' - the flat arra
src/central/equation.rs:252
next →1–100 of 825, ranked by callers