[][src]Enum tensorflow_proto::xla::PrimitiveType

#[repr(i32)]pub enum PrimitiveType {
    Invalid,
    Pred,
    S8,
    S16,
    S32,
    S64,
    U8,
    U16,
    U32,
    U64,
    F16,
    F32,
    Bf16,
    F64,
    C64,
    C128,
    Tuple,
    OpaqueType,
    Token,
}

Primitive types are the individual values that can be held in rectangular multidimensional arrays. A description of the rectangular multidimensional array dimensions / primitive type is given by Shape, below.

Variants

Invalid

Invalid primitive type to serve as default.

Pred

Predicates are two-state booleans.

S8

Signed integral values of fixed width.

S16
S32
S64
U8

Unsigned integral values of fixed width.

U16
U32
U64
F16

Floating-point values of fixed width.

Note: if f16s are not natively supported on the device, they will be converted to f16 from f32 at arbirary points in the computation.

F32
Bf16

Truncated 16 bit floating-point format. This is similar to IEEE's 16 bit floating-point format, but uses 1 bit for the sign, 8 bits for the exponent and 7 bits for the mantissa.

F64
C64

Complex values of fixed width.

Paired F32 (real, imag), as in std::complex.

C128

Paired F64 (real, imag), as in std::complex.

Tuple

A tuple is a polymorphic sequence; e.g. a shape that holds different sub-shapes. They are used for things like returning multiple values from a computation; e.g. a computation that returns weights and biases may have a signature that results in a tuple like (f32[784x2000], f32[2000])

If a shape proto has the tuple element type, it may not have any entries in the dimensions field.

OpaqueType

An opaque type used for passing context-specific data to a custom operation. Shapes of this primitive type will have empty dimensions and tuple_shapes fields.

(OPAQUE would be a better name for this identifier, but that conflicts with a macro defined in windows.h.)

Token

A token type threaded between side-effecting operations. Shapes of this primitive type will have empty dimensions and tuple_shapes fields.

Implementations

impl PrimitiveType[src]

pub fn is_valid(value: i32) -> bool[src]

Returns true if value is a variant of PrimitiveType.

pub fn from_i32(value: i32) -> Option<PrimitiveType>[src]

Converts an i32 to a PrimitiveType, or None if value is not a valid variant.

Trait Implementations

impl Clone for PrimitiveType[src]

impl Copy for PrimitiveType[src]

impl Debug for PrimitiveType[src]

impl Default for PrimitiveType[src]

impl Eq for PrimitiveType[src]

impl From<PrimitiveType> for i32[src]

impl Hash for PrimitiveType[src]

impl Ord for PrimitiveType[src]

impl PartialEq<PrimitiveType> for PrimitiveType[src]

impl PartialOrd<PrimitiveType> for PrimitiveType[src]

impl StructuralEq for PrimitiveType[src]

impl StructuralPartialEq for PrimitiveType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.