pub struct Host;Expand description
Sealed marker for the plain and pooled host payload of a TypedTensor.
TypedTensor<T, R, Host> owns host elements directly, so it offers
infallible host access (as_slice, get, get_mut, Index/IndexMut)
and Clone without a runtime device check. T needs no Copy,
TensorScalar or arithmetic bound for that.
§Examples
use tenferro_tensor::{DynRank, Host, TypedTensor};
let tensor: TypedTensor<f64, DynRank, Host> =
TypedTensor::from_host_vec_col_major(vec![2], vec![1.0, 2.0])?;
assert_eq!(tensor.as_slice(), &[1.0, 2.0]);
assert_eq!(tensor[&[1]], 2.0);Trait Implementations§
Source§impl Representation for Host
impl Representation for Host
Source§fn default_placement() -> Placement
fn default_placement() -> Placement
Placement given to an owner of this representation built without one. Read more
Auto Trait Implementations§
impl Freeze for Host
impl RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin for Host
impl UnsafeUnpin for Host
impl UnwindSafe for Host
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