Struct tfrecord::protos::TensorProto[][src]

pub struct TensorProto {
    pub dtype: i32,
    pub tensor_shape: Option<TensorShapeProto>,
    pub version_number: i32,
    pub tensor_content: Vec<u8>,
    pub half_val: Vec<i32>,
    pub float_val: Vec<f32>,
    pub double_val: Vec<f64>,
    pub int_val: Vec<i32>,
    pub string_val: Vec<Vec<u8>>,
    pub scomplex_val: Vec<f32>,
    pub int64_val: Vec<i64>,
    pub bool_val: Vec<bool>,
    pub dcomplex_val: Vec<f64>,
    pub resource_handle_val: Vec<ResourceHandleProto>,
    pub variant_val: Vec<VariantTensorDataProto>,
    pub uint32_val: Vec<u32>,
    pub uint64_val: Vec<u64>,
}

Protocol buffer representing a tensor.

Fields

dtype: i32tensor_shape: Option<TensorShapeProto>

Shape of the tensor. TODO(touts): sort out the 0-rank issues.

version_number: i32

Version number.

In version 0, if the “repeated xxx” representations contain only one element, that element is repeated to fill the shape. This makes it easy to represent a constant Tensor with a single value.

tensor_content: Vec<u8>

Serialized raw tensor content from either Tensor::AsProtoTensorContent or memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation can be used for all tensor types. The purpose of this representation is to reduce serialization overhead during RPC call by avoiding serialization of many repeated small items.

half_val: Vec<i32>

DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we’ll have some pointless zero padding for each value here.

float_val: Vec<f32>

DT_FLOAT.

double_val: Vec<f64>

DT_DOUBLE.

int_val: Vec<i32>

DT_INT32, DT_INT16, DT_INT8, DT_UINT8.

string_val: Vec<Vec<u8>>

DT_STRING

scomplex_val: Vec<f32>

DT_COMPLEX64. scomplex_val(2i) and scomplex_val(2i+1) are real and imaginary parts of i-th single precision complex.

int64_val: Vec<i64>

DT_INT64

bool_val: Vec<bool>

DT_BOOL

dcomplex_val: Vec<f64>

DT_COMPLEX128. dcomplex_val(2i) and dcomplex_val(2i+1) are real and imaginary parts of i-th double precision complex.

resource_handle_val: Vec<ResourceHandleProto>

DT_RESOURCE

variant_val: Vec<VariantTensorDataProto>

DT_VARIANT

uint32_val: Vec<u32>

DT_UINT32

uint64_val: Vec<u64>

DT_UINT64

Implementations

impl TensorProto[src]

pub fn dtype(&self) -> DataType[src]

Returns the enum value of dtype, or the default if the field is set to an invalid enum value.

pub fn set_dtype(&mut self, value: DataType)[src]

Sets dtype to the provided enum value.

Trait Implementations

impl Clone for TensorProto[src]

impl Debug for TensorProto[src]

impl Default for TensorProto[src]

impl<'de> Deserialize<'de> for TensorProto[src]

impl<S> From<&'_ [S]> for TensorProto where
    S: AsRef<[u8]>, 
[src]

impl<S, D, T> From<&'_ ArrayBase<S, D>> for TensorProto where
    D: Dimension,
    S: RawData<Elem = T> + Data,
    T: TensorProtoElement
[src]

impl<S> From<&'_ Vec<S, Global>> for TensorProto where
    S: AsRef<[u8]>, 
[src]

impl<S, D, T> From<ArrayBase<S, D>> for TensorProto where
    D: Dimension,
    S: RawData<Elem = T> + Data,
    T: TensorProtoElement
[src]

impl<S> From<Vec<S, Global>> for TensorProto where
    S: AsRef<[u8]>, 
[src]

impl Message for TensorProto[src]

impl PartialEq<TensorProto> for TensorProto[src]

impl Serialize for TensorProto[src]

impl StructuralPartialEq for TensorProto[src]

impl TryFrom<&'_ DynamicImage> for TensorProto[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T> TryFrom<&'_ FlatSamples<&'_ [T]>> for TensorProto where
    T: TensorProtoElement
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T> TryFrom<&'_ FlatSamples<&'_ Vec<T, Global>>> for TensorProto where
    T: TensorProtoElement
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T> TryFrom<&'_ FlatSamples<Vec<T, Global>>> for TensorProto where
    T: TensorProtoElement
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<P, C, T> TryFrom<&'_ ImageBuffer<P, C>> for TensorProto where
    P: 'static + Pixel<Subpixel = T>,
    C: Deref<Target = [P::Subpixel]> + AsRef<[P::Subpixel]>,
    T: 'static + TensorProtoElement + Primitive
[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<&'_ Tensor> for TensorProto[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<DynamicImage> for TensorProto[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T> TryFrom<FlatSamples<&'_ [T]>> for TensorProto where
    T: TensorProtoElement
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T> TryFrom<FlatSamples<&'_ Vec<T, Global>>> for TensorProto where
    T: TensorProtoElement
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T> TryFrom<FlatSamples<Vec<T, Global>>> for TensorProto where
    T: TensorProtoElement
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<P, C, T> TryFrom<ImageBuffer<P, C>> for TensorProto where
    P: 'static + Pixel<Subpixel = T>,
    C: Deref<Target = [P::Subpixel]> + AsRef<[P::Subpixel]>,
    T: 'static + TensorProtoElement + Primitive
[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Tensor> for TensorProto[src]

type Error = Error

The type returned in the event of a conversion error.

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.

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