[−][src]Struct tfrecord::protos::TensorProto
Protocol buffer representing a tensor.
Fields
dtype: i32
tensor_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]
fn clone(&self) -> TensorProto
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TensorProto
[src]
impl Default for TensorProto
[src]
fn default() -> TensorProto
[src]
impl<'de> Deserialize<'de> for TensorProto
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'_, S> From<&'_ [S]> for TensorProto where
S: AsRef<[u8]>,
[src]
S: AsRef<[u8]>,
impl<'_, S, D, T> From<&'_ ArrayBase<S, D>> for TensorProto where
D: Dimension,
S: RawData<Elem = T> + Data,
T: TensorProtoElement,
[src]
D: Dimension,
S: RawData<Elem = T> + Data,
T: TensorProtoElement,
impl<'_, S> From<&'_ Vec<S>> for TensorProto where
S: AsRef<[u8]>,
[src]
S: AsRef<[u8]>,
impl<S, D, T> From<ArrayBase<S, D>> for TensorProto where
D: Dimension,
S: RawData<Elem = T> + Data,
T: TensorProtoElement,
[src]
D: Dimension,
S: RawData<Elem = T> + Data,
T: TensorProtoElement,
impl<S> From<Vec<S>> for TensorProto where
S: AsRef<[u8]>,
[src]
S: AsRef<[u8]>,
impl Message for TensorProto
[src]
fn encode_raw<B>(&self, buf: &mut B) where
B: BufMut,
[src]
B: BufMut,
fn merge_field<B>(
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
[src]
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
fn encoded_len(&self) -> usize
[src]
fn clear(&mut self)
[src]
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
fn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
[src]
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
[src]
B: Buf,
Self: Default,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
impl PartialEq<TensorProto> for TensorProto
[src]
fn eq(&self, other: &TensorProto) -> bool
[src]
fn ne(&self, other: &TensorProto) -> bool
[src]
impl Serialize for TensorProto
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for TensorProto
[src]
impl<'_> TryFrom<&'_ DynamicImage> for TensorProto
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: &DynamicImage) -> Result<Self, Self::Error>
[src]
impl<'_, '_, T> TryFrom<&'_ FlatSamples<&'_ [T]>> for TensorProto where
T: TensorProtoElement,
[src]
T: TensorProtoElement,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: &FlatSamples<&[T]>) -> Result<Self, Self::Error>
[src]
impl<'_, '_, T> TryFrom<&'_ FlatSamples<&'_ Vec<T>>> for TensorProto where
T: TensorProtoElement,
[src]
T: TensorProtoElement,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: &FlatSamples<&Vec<T>>) -> Result<Self, Self::Error>
[src]
impl<'_, T> TryFrom<&'_ FlatSamples<Vec<T>>> for TensorProto where
T: TensorProtoElement,
[src]
T: TensorProtoElement,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: &FlatSamples<Vec<T>>) -> Result<Self, Self::Error>
[src]
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]
P: 'static + Pixel<Subpixel = T>,
C: Deref<Target = [P::Subpixel]> + AsRef<[P::Subpixel]>,
T: 'static + TensorProtoElement + Primitive,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: &ImageBuffer<P, C>) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ Tensor> for TensorProto
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: &Tensor) -> Result<Self, Self::Error>
[src]
impl TryFrom<DynamicImage> for TensorProto
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: DynamicImage) -> Result<Self, Self::Error>
[src]
impl<'_, T> TryFrom<FlatSamples<&'_ [T]>> for TensorProto where
T: TensorProtoElement,
[src]
T: TensorProtoElement,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: FlatSamples<&[T]>) -> Result<Self, Self::Error>
[src]
impl<'_, T> TryFrom<FlatSamples<&'_ Vec<T>>> for TensorProto where
T: TensorProtoElement,
[src]
T: TensorProtoElement,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: FlatSamples<&Vec<T>>) -> Result<Self, Self::Error>
[src]
impl<T> TryFrom<FlatSamples<Vec<T>>> for TensorProto where
T: TensorProtoElement,
[src]
T: TensorProtoElement,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: FlatSamples<Vec<T>>) -> Result<Self, Self::Error>
[src]
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]
P: 'static + Pixel<Subpixel = T>,
C: Deref<Target = [P::Subpixel]> + AsRef<[P::Subpixel]>,
T: 'static + TensorProtoElement + Primitive,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: ImageBuffer<P, C>) -> Result<Self, Self::Error>
[src]
impl TryFrom<Tensor> for TensorProto
[src]
Auto Trait Implementations
impl RefUnwindSafe for TensorProto
impl Send for TensorProto
impl Sync for TensorProto
impl Unpin for TensorProto
impl UnwindSafe for TensorProto
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,