Skip to main content

Parameter

Trait Parameter 

Source
pub trait Parameter:
    Clone
    + Debug
    + Send {
    type Device: Clone;

    // Required methods
    fn device(&self) -> Self::Device;
    fn is_require_grad(&self) -> bool;
    fn set_require_grad(self, require_grad: bool) -> Self;
}
Expand description

Trait that defines what is necessary for a type to be a parameter.

Required Associated Types§

Source

type Device: Clone

The device type to be used.

Required Methods§

Source

fn device(&self) -> Self::Device

Fetch the device.

Source

fn is_require_grad(&self) -> bool

Fetch the gradient requirement.

Source

fn set_require_grad(self, require_grad: bool) -> Self

Set the gradient requirement.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<B: Backend, const D: usize> Parameter for Tensor<B, D, Bool>

Source§

impl<B: Backend, const D: usize> Parameter for Tensor<B, D, Float>

Source§

impl<B: Backend, const D: usize> Parameter for Tensor<B, D, Int>