Trait dfdx::tensor::DeviceStorage
source · pub trait DeviceStorage: 'static + Debug + Default + Clone + HasErr {
type Vec<E: Unit>: 'static + Debug + Clone + Send + Sync;
// Required methods
fn random_u64(&self) -> u64;
fn try_alloc_grad<E: Unit>(
&self,
storage: &Self::Vec<E>
) -> Result<Self::Vec<E>, Self::Err>;
fn tensor_to_vec<S: Shape, E: Unit, T>(
&self,
tensor: &Tensor<S, E, Self, T>
) -> Vec<E>;
}
Required Associated Types§
Required Methods§
sourcefn random_u64(&self) -> u64
fn random_u64(&self) -> u64
Generates a random u64 number
sourcefn try_alloc_grad<E: Unit>(
&self,
storage: &Self::Vec<E>
) -> Result<Self::Vec<E>, Self::Err>
fn try_alloc_grad<E: Unit>( &self, storage: &Self::Vec<E> ) -> Result<Self::Vec<E>, Self::Err>
Allocates a gradient for the given nd array