pub struct TensorProto {Show 17 fields
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>,
}
Expand description
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§
Trait Implementations§
Source§impl Clone for TensorProto
impl Clone for TensorProto
Source§fn clone(&self) -> TensorProto
fn clone(&self) -> TensorProto
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TensorProto
impl Debug for TensorProto
Source§impl Default for TensorProto
impl Default for TensorProto
Source§impl From<TensorProto> for AttrValue
impl From<TensorProto> for AttrValue
Source§fn from(t: TensorProto) -> AttrValue
fn from(t: TensorProto) -> AttrValue
Source§impl Message for TensorProto
impl Message for TensorProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.Source§impl PartialEq for TensorProto
impl PartialEq for TensorProto
Source§impl TryFrom<&Tensor> for TensorProto
impl TryFrom<&Tensor> for TensorProto
Source§fn try_from(from: &Tensor) -> TractResult<TensorProto>
fn try_from(from: &Tensor) -> TractResult<TensorProto>
Source§impl TryFrom<&TensorProto> for Tensor
impl TryFrom<&TensorProto> for Tensor
Source§fn try_from(t: &TensorProto) -> TractResult<Tensor>
fn try_from(t: &TensorProto) -> TractResult<Tensor>
impl StructuralPartialEq for TensorProto
Auto Trait Implementations§
impl Freeze for TensorProto
impl RefUnwindSafe for TensorProto
impl Send for TensorProto
impl Sync for TensorProto
impl Unpin for TensorProto
impl UnwindSafe for TensorProto
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
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> ⓘ
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