pub trait Value: ValueSpec {
// Required methods
fn tensors(&self) -> Self::Tensors;
fn grad(
tensors: &Self::Tensors,
grad_map: &HashMap<usize, Tensor>,
) -> Self::Gradient;
fn grad_map(
tensors: &Self::Tensors,
grad: Self::Gradient,
out: &mut HashMap<usize, Tensor>,
);
// Provided method
fn to_tensor_vec(&self) -> Vec<Tensor> { ... }
}
Required Methods§
fn tensors(&self) -> Self::Tensors
fn grad( tensors: &Self::Tensors, grad_map: &HashMap<usize, Tensor>, ) -> Self::Gradient
fn grad_map( tensors: &Self::Tensors, grad: Self::Gradient, out: &mut HashMap<usize, Tensor>, )
Provided Methods§
fn to_tensor_vec(&self) -> Vec<Tensor>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.