pub struct ShmTensor<T>{
pub name: String,
pub fd: OwnedFd,
pub shape: Vec<usize>,
pub _marker: PhantomData<T>,
}Fields§
§name: String§fd: OwnedFd§shape: Vec<usize>§_marker: PhantomData<T>Trait Implementations§
Source§impl<T> TensorTrait<T> for ShmTensor<T>
impl<T> TensorTrait<T> for ShmTensor<T>
Source§fn new(shape: &[usize], name: Option<&str>) -> Result<Self>
fn new(shape: &[usize], name: Option<&str>) -> Result<Self>
Create a new tensor with the given shape and optional name. If no name
is given, a random name will be generated.
Source§fn from_fd(fd: OwnedFd, shape: &[usize], name: Option<&str>) -> Result<Self>
fn from_fd(fd: OwnedFd, shape: &[usize], name: Option<&str>) -> Result<Self>
Create a new tensor using the given file descriptor, shape, and optional
name. If no name is given, a random name will be generated. Read more
Source§fn memory(&self) -> TensorMemory
fn memory(&self) -> TensorMemory
Get the memory type of this tensor.
Source§fn reshape(&mut self, shape: &[usize]) -> Result<()>
fn reshape(&mut self, shape: &[usize]) -> Result<()>
Reshape this tensor to the given shape. The total number of elements
must remain the same.
impl<T> Send for ShmTensor<T>
impl<T> Sync for ShmTensor<T>
Auto Trait Implementations§
impl<T> Freeze for ShmTensor<T>
impl<T> RefUnwindSafe for ShmTensor<T>where
T: RefUnwindSafe,
impl<T> Unpin for ShmTensor<T>where
T: Unpin,
impl<T> UnwindSafe for ShmTensor<T>where
T: UnwindSafe,
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 more