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

Method cosine

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

Return the cached cosine value for the given position and sequence length. When `device` differs from the cache's own device, the result is copied to that device (enables multi-GPU workers).

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

Source from the content-addressed store, hash-verified

138 /// When `device` differs from the cache's own device, the result is copied
139 /// to that device (enables multi-GPU workers).
140 pub fn cosine(&self, index_pos: usize, seq_len: usize, device: &Device) -> Result<Tensor> {
141 self.cos.narrow(0, index_pos, seq_len)?.to_device(device)
142 }
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> {

Callers 7

cache_cosineFunction · 0.80
apply_rotary_embMethod · 0.80
test_cos_sin_shapeFunction · 0.80

Calls

no outgoing calls