MCPcopy Create free account
hub / github.com/evilsocket/cake / sine

Method sine

cake-core/src/models/common/cache.rs:145–147  ·  view source on GitHub ↗

Return the cached sine value for the given position and sequence length.

(&self, index_pos: usize, seq_len: usize, device: &Device)

Source from the content-addressed store, hash-verified

143
144 /// Return the cached sine value for the given position and sequence length.
145 pub fn sine(&self, index_pos: usize, seq_len: usize, device: &Device) -> Result<Tensor> {
146 self.sin.narrow(0, index_pos, seq_len)?.to_device(device)
147 }
148
149 /// Get the attention mask for the given sequence length.
150 pub fn mask(&mut self, seq_len: usize, device: &Device) -> Result<Tensor> {

Callers 3

apply_rotary_embMethod · 0.80
test_cos_sin_shapeFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_cos_sin_shapeFunction · 0.64