pub struct SparseTensorProto {
pub values: Option<TensorProto>,
pub indices: Option<TensorProto>,
pub dims: Vec<i64>,
}
Expand description
A serialized sparse-tensor value
Fields§
§values: Option<TensorProto>
The sequence of non-default values are encoded as a tensor of shape [NNZ]. The default-value is zero for numeric tensors, and empty-string for string tensors.
indices: Option<TensorProto>
The indices of the non-default values, which may be stored in one of two formats. (a) Indices can be a tensor of shape [NNZ, rank] with the [i,j]-th value corresponding to the j-th index of the i-th value (in the values tensor). (b) Indices can be a tensor of shape [NNZ], in which case the i-th value must be the linearized-index of the i-th value (in the values tensor). The linearized-index can be converted into an index tuple (k_1,…,k_rank) using the shape provided below. The indices must appear in ascending order without duplication. In the first format, the ordering is lexicographic-ordering: e.g., index-value [1,4] must appear before [2,1]
dims: Vec<i64>
The shape of the underlying dense-tensor: [dim_1, dim_2, … dim_rank]
Trait Implementations§
Source§impl Clone for SparseTensorProto
impl Clone for SparseTensorProto
Source§fn clone(&self) -> SparseTensorProto
fn clone(&self) -> SparseTensorProto
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SparseTensorProto
impl Debug for SparseTensorProto
Source§impl Default for SparseTensorProto
impl Default for SparseTensorProto
Source§fn default() -> SparseTensorProto
fn default() -> SparseTensorProto
Source§impl Message for SparseTensorProto
impl Message for SparseTensorProto
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_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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
.