Trait burn::prelude::ElementConversion

pub trait ElementConversion {
    // Required methods
    fn from_elem<E>(elem: E) -> Self
       where E: ToElement;
    fn elem<E>(self) -> E
       where E: Element;
}
Expand description

Element conversion trait for tensor.

Required Methods§

fn from_elem<E>(elem: E) -> Self
where E: ToElement,

Converts an element to another element.

§Arguments
  • elem - The element to convert.
§Returns

The converted element.

fn elem<E>(self) -> E
where E: Element,

Converts and returns the converted element.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl ElementConversion for bool

§

fn from_elem<E>(elem: E) -> bool
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for f32

§

fn from_elem<E>(elem: E) -> f32
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for f64

§

fn from_elem<E>(elem: E) -> f64
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for i8

§

fn from_elem<E>(elem: E) -> i8
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for i16

§

fn from_elem<E>(elem: E) -> i16
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for i32

§

fn from_elem<E>(elem: E) -> i32
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for i64

§

fn from_elem<E>(elem: E) -> i64
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for u8

§

fn from_elem<E>(elem: E) -> u8
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for u32

§

fn from_elem<E>(elem: E) -> u32
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

§

impl ElementConversion for u64

§

fn from_elem<E>(elem: E) -> u64
where E: ToElement,

§

fn elem<E>(self) -> E
where E: Element,

Implementors§