MCPcopy Create free account

hub / github.com/Narsil/smelte-rs / functions

Functions212 in github.com/Narsil/smelte-rs

↓ 92 callersMethodshape
The shape of the tensor ``` use smelte_rs::gpu::f32::{Tensor, Device}; let device = Device::new(0).unwrap(); let tensor = Tensor::zeros(vec![2, 2], &
src/gpu/f32/tensor.rs:44
↓ 48 callersMethodshape
The shape of the tensor ``` use smelte_rs::cpu::f32::Tensor; let tensor = Tensor::zeros(vec![2, 2]); assert_eq!(tensor.shape(), vec![2, 2]); ```
src/cpu/f32/tensor.rs:23
↓ 40 callersMethodshape
The shape of the tensor ``` use smelte-rs::cpu::f16::Tensor; let tensor = Tensor::zeros(vec![2, 2]); assert_eq!(tensor.shape(), vec![2, 2]); ```
src/cpu/f16/tensor.rs:20
↓ 36 callersMethoddevice_id
The device id
src/gpu/f32/tensor.rs:74
↓ 34 callersMethoddata
The [CudaSlice] holding the data
src/gpu/f32/tensor.rs:49
↓ 34 callersMethodzeros
Creates a new nulled tensor with given shape ``` use smelte_rs::gpu::f32::{Tensor, Device}; let device = Device::new(0).unwrap(); let tensor = Tensor
src/gpu/f32/tensor.rs:85
↓ 27 callersMethoddata_mut
A mutable borrow of [CudaSlice] holding the data
src/gpu/f32/tensor.rs:54
↓ 16 callersMethodcuda
The device of the device
src/gpu/f32/tensor.rs:64
↓ 13 callersMethoddata
A slice to the underlying tensor data ``` use smelte_rs::cpu::f32::Tensor; let tensor = Tensor::zeros(vec![2, 2]); assert_eq!(tensor.data(), vec![0.0
src/cpu/f32/tensor.rs:34
↓ 13 callersMethoddata_mut
A mutable slice to the underlying tensor data ``` use smelte_rs::cpu::f32::Tensor; let mut tensor = Tensor::zeros(vec![2, 2]); tensor.data_mut().iter
src/cpu/f32/tensor.rs:58
↓ 11 callersFunctionmatmul
Regular matrix multiplication
src/gpu/f32/ops.rs:87
↓ 11 callersFunctionmatmul_t
Matrix multiplication matmul(A, B.transposed())
src/gpu/f32/ops.rs:92
↓ 10 callersFunctionadd
tensor elementwise addition. b += a.
src/gpu/f32/ops.rs:221
↓ 9 callersFunctiondevice
()
src/gpu/f32/ops.rs:474
↓ 8 callersMethoddata_mut
A mutable slice to the underlying tensor data ``` use smelte-rs::cpu::f16::Tensor; let mut tensor = Tensor::zeros(vec![2, 2]); tensor.data_mut().iter
src/cpu/f16/tensor.rs:43
↓ 8 callersFunctionto_tensor
(view: TensorView<'data>, device: &Device)
examples/gpt2.rs:47
↓ 8 callersMethodweight
TODO
src/nn/layers/linear.rs:25
↓ 7 callersMethodforward
TODO
src/nn/models/bert.rs:357
↓ 7 callersFunctionto_tensor
(view: TensorView<'data>, device: &Device)
examples/bert.rs:63
↓ 6 callersFunctioncausal_softmax
Causal softmax on the last dimension for tensor `x`. The causality is determined by the shape of `x` and `past_sequence_length` which defines how big
src/gpu/f32/ops.rs:411
↓ 6 callersMethoddata
A slice to the underlying tensor data ``` use smelte-rs::cpu::f16::Tensor; let tensor = Tensor::zeros(vec![2, 2]); assert_eq!(tensor.data(), vec![0.0
src/cpu/f16/tensor.rs:31
↓ 6 callersFunctionlinear_from_prefix
( prefix: &str, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/bert.rs:108
↓ 6 callersFunctionmatmul
Regular matrix multiplication
src/cpu/f32/ops.rs:48
↓ 6 callersFunctionsoftmax
Softmax on the last dimension for tensor `x`
src/gpu/f32/ops.rs:404
↓ 5 callersFunctionbroadcast_add
broacasted tensor elementwise addition. b += a.
src/gpu/f32/ops.rs:252
↓ 5 callersFunctionmatmul_t
Matrix multiplication matmul(A, B.transposed())
src/cpu/f32/ops.rs:53
↓ 4 callersFunctioncausal_softmax
Causal softmax on the last dimension for tensor `x`. The causality is determined by the shape of `x` and `past_sequence_length` which defines how big
src/cpu/f32/ops.rs:362
↓ 4 callersFunctioncausal_softmax
Causal softmax on the last dimension for tensor `x`. The causality is determined by the shape of `x` and `past_sequence_length` which defines how big
src/cpu/f16/ops.rs:299
↓ 4 callersFunctioncuda_split_heads
( src: &F32CudaTensor, dst: &mut F32CudaTensor, )
src/nn/models/bert.rs:180
↓ 4 callersFunctionlinear_from_prefix
( prefix: &str, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/gpt2.rs:96
↓ 4 callersFunctionmatmul
Regular matrix multiplication
src/cpu/f16/ops.rs:60
↓ 4 callersFunctionmatmul_t
Matrix multiplication matmul(A, B.transposed())
src/cpu/f16/ops.rs:65
↓ 4 callersFunctionnormalize
Basic operation for the layernorm. x = (x - x.mean()) / (x.var() + epsilon) `mean` and `var` do not have to be initialized, they are simply passed to
src/gpu/f32/ops.rs:355
↓ 4 callersFunctionselect
Operation for selecting entire rows within tensor `weights`. Each `id` is the index of the row.
src/gpu/f32/ops.rs:42
↓ 4 callersFunctionsplit_heads
(q: &F32Tensor, out_q: &mut F32Tensor)
src/nn/models/bert.rs:73
↓ 3 callersFunctionapply
Applies `func` to every item of the tensor
src/cpu/f32/ops.rs:432
↓ 3 callersFunctioncopy
Copy tensor into another tensor
src/gpu/f32/ops.rs:81
↓ 3 callersMethoddevice
The device of the device
src/gpu/f32/tensor.rs:59
↓ 3 callersFunctionembedding_from
(weights: TensorView<'a>, device: &Device)
examples/bert.rs:120
↓ 3 callersMethodforward
TODO
src/nn/models/gpt2.rs:458
↓ 3 callersFunctiongelu
(x: &mut Tensor)
src/gpu/f32/ops.rs:437
↓ 3 callersFunctionlayer_norm_from_prefix
( prefix: &str, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/bert.rs:270
↓ 3 callersFunctionlayer_norm_from_prefix
( prefix: &str, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/gpt2.rs:152
↓ 3 callersFunctionlinear_from
( weights: TensorView<'a>, bias: TensorView<'a>, device: &Device, )
examples/bert.rs:97
↓ 2 callersFunctionattention
( q_weights: &Linear<F32Tensor>, k_weights: &Linear<F32Tensor>, v_weights: &Linear<F32
src/nn/models/bert.rs:109
↓ 2 callersFunctionattention
( qkv_weights: &LinearT<F32Tensor>, ctx: &mut Gpt2Context<F32Tensor>, i: usize, )
src/nn/models/gpt2.rs:245
↓ 2 callersFunctionbroadcast_add
broacasted tensor elementwise addition. b += a.
src/cpu/f32/ops.rs:241
↓ 2 callersFunctionbroadcast_mul
broadcasted tensor elementwise multiplication. b *= a.
src/gpu/f32/ops.rs:317
↓ 2 callersFunctioncuda_unsplit_heads
( src: &F32CudaTensor, dst: &mut F32CudaTensor, )
src/nn/models/bert.rs:216
↓ 2 callersFunctiondevice
()
src/nn/models/bert.rs:668
↓ 2 callersFunctionembedding_from
(weights: TensorView<'a>, device: &Device)
examples/gpt2.rs:108
↓ 2 callersFunctionexp
(x: f32)
src/cpu/f32/ops.rs:398
↓ 2 callersFunctionmul
tensor elementwise multiplication. b *= a.
src/gpu/f32/ops.rs:285
↓ 2 callersFunctionmul_scalar
(x: &mut Tensor, factor: f32)
src/gpu/f32/ops.rs:453
↓ 2 callersFunctionnormalize
Basic operation for the layernorm. x = (x - x.mean()) / (x.var() + epsilon) `mean` and `var` do not have to be initialized, they are simply passed to
src/cpu/f32/ops.rs:297
↓ 2 callersMethodrun
TODO
src/nn/models/bert.rs:649
↓ 2 callersFunctionselect
Operation for selecting entire rows within tensor `weights`. Each `id` is the index of the row.
src/cpu/f32/ops.rs:18
↓ 2 callersFunctionsoftmax
Softmax on the last dimension for tensor `x`
src/cpu/f32/ops.rs:355
↓ 2 callersFunctionsplit_qkv
(ctx: &mut Gpt2Context<F32Tensor>, i: usize)
src/nn/models/gpt2.rs:193
↓ 2 callersFunctiontanh
(x: &mut Tensor)
src/gpu/f32/ops.rs:418
↓ 2 callersFunctionunsplit_heads
(src: &F32Tensor, dst: &mut F32Tensor)
src/nn/models/bert.rs:92
↓ 1 callersFunctionadd
tensor elementwise addition. b += a.
src/cpu/f32/ops.rs:226
↓ 1 callersFunctionbert_attention_from_tensors
( index: usize, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/bert.rs:214
↓ 1 callersFunctionbert_layer_from_tensors
( index: usize, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/bert.rs:205
↓ 1 callersFunctionbert_mlp_from_tensors
( index: usize, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/bert.rs:247
↓ 1 callersMethodblas
The CudaBlas handle
src/gpu/f32/tensor.rs:69
↓ 1 callersFunctionbroadcast_mul
broacasted tensor elementwise multiplication. b += a.
src/cpu/f32/ops.rs:275
↓ 1 callersFunctionbuild_ptx
()
build.rs:111
↓ 1 callersFunctioncopy
Copy tensor into another tensor
src/cpu/f32/ops.rs:42
↓ 1 callersMethodcpu_data
Returns a cpu vec containing copied data from the device.
src/gpu/f32/tensor.rs:114
↓ 1 callersFunctioncuda_attention
( q_weights: &Linear<F32CudaTensor>, k_weights: &Linear<F32CudaTensor>, v_weights: &Li
src/nn/models/bert.rs:251
↓ 1 callersFunctioncuda_attention
( qkv: &LinearT<F32CudaTensor>, ctx: &mut Gpt2Context<F32CudaTensor>, i: usize, )
src/nn/models/gpt2.rs:384
↓ 1 callersFunctionfaster_tanh
utility function to use a faster but less precise tanh
src/cpu/f32/ops.rs:386
↓ 1 callersFunctionfaster_tanh
utility function to use a faster but less precise tanh
src/cpu/f16/ops.rs:323
↓ 1 callersMethodforward
Forward pass
src/nn/layers/linear.rs:18
↓ 1 callersMethodforward
TODO
src/nn/layers/embedding.rs:17
↓ 1 callersMethodforward
TODO
src/nn/layers/layer_norm.rs:23
↓ 1 callersMethodgenerate
TODO
src/nn/models/gpt2.rs:141
↓ 1 callersFunctionget_label
(id2label: Option<&HashMap<String, String>>, i: usize)
examples/bert.rs:51
↓ 1 callersFunctiongpt2_attention_from_tensors
( index: usize, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/gpt2.rs:132
↓ 1 callersFunctiongpt2_from_tensors
(tensors: &SafeTensors, device: &Device, num_heads: usize)
examples/gpt2.rs:112
↓ 1 callersFunctiongpt2_layer_from_tensors
( index: usize, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/gpt2.rs:121
↓ 1 callersFunctiongpt2_mlp_from_tensors
( index: usize, tensors: &'a SafeTensors<'a>, device: &Device, )
examples/gpt2.rs:142
↓ 1 callersMethodid2label
(&self)
examples/bert.rs:46
↓ 1 callersFunctioninline_tanh
(x: f32)
src/cpu/f32/ops.rs:410
↓ 1 callersFunctioninline_tanh
(x: f16)
src/cpu/f16/ops.rs:335
↓ 1 callersFunctionlinear_from
( weights: TensorView<'a>, bias: TensorView<'a>, device: &Device, )
examples/gpt2.rs:81
↓ 1 callersFunctionmul
tensor elementwise multiplication. b += a.
src/cpu/f32/ops.rs:260
↓ 1 callersMethodnew_context
TODO
src/nn/models/bert.rs:599
↓ 1 callersMethodnew_context
TODO
src/nn/models/gpt2.rs:622
↓ 1 callersMethodnew_tokens
TODO
src/nn/models/gpt2.rs:85
↓ 1 callersFunctionnormalize
Basic operation for the layernorm. x = (x - x.mean()) / (x.var() + epsilon) `mean` and `var` do not have to be initialized, they are simply passed to
src/cpu/f16/ops.rs:234
↓ 1 callersFunctionrun
()
examples/bert.rs:321
↓ 1 callersFunctionrun
()
examples/gpt2.rs:203
↓ 1 callersFunctionselect
Operation for selecting entire rows within tensor `weights`. Each `id` is the index of the row.
src/cpu/f16/ops.rs:40
↓ 1 callersMethodset_num_heads
TODO
src/nn/models/bert.rs:585
↓ 1 callersFunctionsoftmax
Softmax on the last dimension for tensor `x`
src/cpu/f16/ops.rs:292
↓ 1 callersFunctionto_f32
(view: TensorView)
examples/bert.rs:77
↓ 1 callersFunctionto_f32
(view: TensorView)
examples/gpt2.rs:61
↓ 1 callersFunctionunbiased_linear_from
(weights: TensorView<'a>, device: &Device)
examples/gpt2.rs:92
next →1–100 of 212, ranked by callers