[−][src]Struct tract_tensorflow::tfpb::tensorflow::StructuredValue
StructuredValue
represents a dynamically typed value representing various
data structures that are inspired by Python data structures typically used in
TensorFlow functions as inputs and outputs.
For example when saving a Layer there may be a training
argument. If the
user passes a boolean True/False, that switches between two concrete
TensorFlow functions. In order to switch between them in the same way after
loading the SavedModel, we need to represent "True" and "False".
A more advanced example might be a function which takes a list of
dictionaries mapping from strings to Tensors. In order to map from
user-specified arguments [{"a": tf.constant(1.)}, {"q": tf.constant(3.)}]
after load to the right saved TensorFlow function, we need to represent the
nested structure and the strings, recording that we have a trace for anything
matching [{"a": tf.TensorSpec(None, tf.float32)}, {"q": tf.TensorSpec([], tf.float64)}]
as an example.
Likewise functions may return nested structures of Tensors, for example returning a dictionary mapping from strings to Tensors. In order for the loaded function to return the same structure we need to serialize it.
This is an ergonomic aid for working with loaded SavedModels, not a promise to serialize all possible function signatures. For example we do not expect to pickle generic Python objects, and ideally we'd stay language-agnostic.
Fields
kind: Option<Kind>
The kind of value.
Trait Implementations
impl Clone for StructuredValue
[src]
fn clone(&self) -> StructuredValue
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for StructuredValue
[src]
impl Default for StructuredValue
[src]
fn default() -> StructuredValue
[src]
impl Message for StructuredValue
[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<StructuredValue> for StructuredValue
[src]
fn eq(&self, other: &StructuredValue) -> bool
[src]
fn ne(&self, other: &StructuredValue) -> bool
[src]
impl StructuralPartialEq for StructuredValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for StructuredValue
impl Send for StructuredValue
impl Sync for StructuredValue
impl Unpin for StructuredValue
impl UnwindSafe for StructuredValue
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> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>ⓘ
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,