Trait Parameter
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§
Required Methods§
fn is_require_grad(&self) -> bool
fn is_require_grad(&self) -> bool
Fetch the gradient requirement.
fn set_require_grad(self, require_grad: bool) -> Self
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", so this trait is not object safe.