Skip to main content

Bool

Struct Bool 

Source
pub struct Bool;

Trait Implementations§

Source§

impl<D: Device> BytesDTypeKind<D> for Bool

Source§

fn from_bytes_dispatch( bytes: &[u8], shape: &Shape, device: &D, _dtype: BoolDType, ) -> Result<Self::Storage>

Source§

fn to_bytes_dispatch<'a>( storage: &'a Self::Storage, layout: &Layout, ) -> Result<Cow<'a, [u8]>>

Source§

impl<D: Device> DTypeKind<D> for Bool

Source§

const KIND: KindTag = KindTag::Bool

Runtime discriminant for this kind.
Source§

type Scalar = bool

Source§

type Storage = <D as Device>::BoolStorage

Source§

type Meta = ()

Source§

type DType = BoolDType

Source§

impl<D: Device, T: BoolFrom> IntoTensor<D, Bool> for T

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device, T: BoolFrom> IntoTensor<D, Bool> for &[T]

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device, T: BoolFrom> IntoTensor<D, Bool> for Vec<T>

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device, T: BoolFrom, const N: usize> IntoTensor<D, Bool> for [T; N]

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device, T: BoolFrom, const N: usize> IntoTensor<D, Bool> for &[T; N]

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device, T: BoolFrom, const R: usize, const C: usize> IntoTensor<D, Bool> for &[[T; C]; R]

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device, T: BoolFrom, const D1: usize, const D2: usize, const D3: usize> IntoTensor<D, Bool> for &[[[T; D3]; D2]; D1]

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device, T: BoolFrom, const D1: usize, const D2: usize, const D3: usize, const D4: usize> IntoTensor<D, Bool> for &[[[[T; D4]; D3]; D2]; D1]

Source§

fn shape(&self) -> Result<Shape>

Source§

fn into_storage(self, device: &D) -> Result<D::BoolStorage>

Source§

impl<D: Device> ShapeDTypeKind<D> for Bool

Source§

fn contiguous_dispatch(s: &Self::Storage, l: &Layout) -> Result<Self::Storage>

Source§

fn cat_dispatch( srcs: &[(&Self::Storage, &Layout)], dim: usize, ) -> Result<(Self::Storage, Shape)>

Source§

fn view_dispatch( src: &Self::Storage, src_l: &Layout, dst_l: &Layout, view: ViewOp, ) -> Result<Option<Self::Storage>>

Source§

impl Storage<Cpu, Bool> for CpuBoolStorage

Source§

fn dtype(&self) -> BoolDType

Source§

fn device(&self) -> &Cpu

Source§

impl<D: Device, D2: Device> TransferDTypeKind<D, D2> for Bool

Source§

fn transfer(src: &Tensor<D, Bool>, device: &D2) -> Result<Tensor<D2, Bool>>

Auto Trait Implementations§

§

impl Freeze for Bool

§

impl RefUnwindSafe for Bool

§

impl Send for Bool

§

impl Sync for Bool

§

impl Unpin for Bool

§

impl UnsafeUnpin for Bool

§

impl UnwindSafe for Bool

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V