pub struct ModelInput {
pub name: String,
pub data_type: i32,
pub format: i32,
pub dims: Vec<i64>,
pub reshape: Option<ModelTensorReshape>,
pub is_shape_tensor: bool,
pub allow_ragged_batch: bool,
pub optional: bool,
}
Expand description
@@ @@.. cpp:var:: message ModelInput @@ @@ An input required by the model. @@
Fields§
§name: String
@@ .. cpp:var:: string name @@ @@ The name of the input. @@
data_type: i32
@@ .. cpp:var:: DataType data_type @@ @@ The data-type of the input. @@
format: i32
@@ .. cpp:var:: Format format @@ @@ The format of the input. Optional. @@
dims: Vec<i64>
@@ .. cpp:var:: int64 dims (repeated) @@ @@ The dimensions/shape of the input tensor that must be provided @@ when invoking the inference API for this model. @@
reshape: Option<ModelTensorReshape>
@@ .. cpp:var:: ModelTensorReshape reshape @@ @@ The shape expected for this input by the backend. The input will @@ be reshaped to this before being presented to the backend. The @@ reshape must have the same number of elements as the input shape @@ specified by ‘dims’. Optional. @@
is_shape_tensor: bool
@@ .. cpp:var:: bool is_shape_tensor @@ @@ Whether or not the input is a shape tensor to the model. This field @@ is currently supported only for the TensorRT model. An error will be @@ generated if this specification does not comply with underlying @@ model. @@
allow_ragged_batch: bool
@@ .. cpp:var:: bool allow_ragged_batch @@ @@ Whether or not the input is allowed to be “ragged” in a dynamically @@ created batch. Default is false indicating that two requests will @@ only be batched if this tensor has the same shape in both requests. @@ True indicates that two requests can be batched even if this tensor @@ has a different shape in each request. @@
optional: bool
@@ .. cpp:var:: bool optional @@ @@ Whether or not the input is optional for the model execution. @@ If true, the input is not required in the inference request. @@ Default value is false. @@
Implementations§
Source§impl ModelInput
impl ModelInput
Sourcepub fn data_type(&self) -> DataType
pub fn data_type(&self) -> DataType
Returns the enum value of data_type
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_data_type(&mut self, value: DataType)
pub fn set_data_type(&mut self, value: DataType)
Sets data_type
to the provided enum value.
Sourcepub fn format(&self) -> Format
pub fn format(&self) -> Format
Returns the enum value of format
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_format(&mut self, value: Format)
pub fn set_format(&mut self, value: Format)
Sets format
to the provided enum value.
Trait Implementations§
Source§impl Clone for ModelInput
impl Clone for ModelInput
Source§fn clone(&self) -> ModelInput
fn clone(&self) -> ModelInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ModelInput
impl Debug for ModelInput
Source§impl Default for ModelInput
impl Default for ModelInput
Source§impl Message for ModelInput
impl Message for ModelInput
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 ModelInput
impl PartialEq for ModelInput
impl StructuralPartialEq for ModelInput
Auto Trait Implementations§
impl Freeze for ModelInput
impl RefUnwindSafe for ModelInput
impl Send for ModelInput
impl Sync for ModelInput
impl Unpin for ModelInput
impl UnwindSafe for ModelInput
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request