pub struct EmbeddingHandle {
pub name: String,
pub module: Option<PyObject>,
pub trainable: bool,
pub dim: usize,
pub vocab_size: usize,
}Expand description
Handle to a registered embedding module.
Wraps either a trainable nn.Embedding or a frozen torch.Tensor.
Created via CompiledProgram.register_embedding() in Python.
Fields§
§name: StringUnique name matching the nn() declaration
module: Option<PyObject>The PyTorch nn.Embedding or tensor
trainable: boolWhether gradients flow through this embedding
dim: usizeEmbedding vector dimension (second axis of weight matrix)
vocab_size: usizeNumber of embedding entries (first axis of weight matrix)
Implementations§
Source§impl EmbeddingHandle
impl EmbeddingHandle
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EmbeddingHandle
impl !RefUnwindSafe for EmbeddingHandle
impl Send for EmbeddingHandle
impl Sync for EmbeddingHandle
impl Unpin for EmbeddingHandle
impl UnsafeUnpin for EmbeddingHandle
impl UnwindSafe for EmbeddingHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more