pub struct Layer {
pub elem2idx: Vec<usize>,
pub idx2vtx: Vec<usize>,
}Fields§
§elem2idx: Vec<usize>§idx2vtx: Vec<usize>Trait Implementations§
Source§impl CustomOp1 for Layer
impl CustomOp1 for Layer
Source§fn bwd(
&self,
vtx2xy: &Tensor,
_elem2cog: &Tensor,
dw_elem2cog: &Tensor,
) -> Result<Option<Tensor>>
fn bwd( &self, vtx2xy: &Tensor, _elem2cog: &Tensor, dw_elem2cog: &Tensor, ) -> Result<Option<Tensor>>
This function takes as argument the argument arg used in the forward pass, the result
produced by the forward operation res and the gradient of the result grad_res.
The function should return the gradient of the argument.
fn name(&self) -> &'static str
Source§fn cpu_fwd(
&self,
storage: &CpuStorage,
layout: &Layout,
) -> Result<(CpuStorage, Shape)>
fn cpu_fwd( &self, storage: &CpuStorage, layout: &Layout, ) -> Result<(CpuStorage, Shape)>
The forward pass, as run on a cpu device. Note that the storage can use arbitrary strides,
offsets etc so the associated layout should be used to access it.
Source§fn cuda_fwd(
&self,
_storage: &CudaStorage,
_layout: &Layout,
) -> Result<(CudaStorage, Shape), Error>
fn cuda_fwd( &self, _storage: &CudaStorage, _layout: &Layout, ) -> Result<(CudaStorage, Shape), Error>
The forward pass, as run on a gpu device. Note that the storage can use arbitrary strides,
offsets etc so the associated layout should be used to access it.
Source§fn metal_fwd(
&self,
_storage: &MetalStorage,
_layout: &Layout,
) -> Result<(MetalStorage, Shape), Error>
fn metal_fwd( &self, _storage: &MetalStorage, _layout: &Layout, ) -> Result<(MetalStorage, Shape), Error>
The forward pass, as run on a metal gpu device. Note that the storage can use arbitrary strides,
offsets etc so the associated layout should be used to access it.
Auto Trait Implementations§
impl Freeze for Layer
impl RefUnwindSafe for Layer
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnwindSafe for Layer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.