Return the cached sine value for the given position and sequence length.
(&self, index_pos: usize, seq_len: usize, device: &Device)
| 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> { |
no outgoing calls