pub struct BoundShapeInferencer { /* private fields */ }

Implementations§

source§

impl BoundShapeInferencer

source

pub fn new(spec: &BoundShapeSpec) -> Self

source

pub fn ensure_shape_names(&self, info: *mut HashMap<String, ShapeInfo>)

source

pub fn initialize(&mut self, info: &ShapeInfoMap, extract_feature_len: bool)

| Initialize private parameters, such as | shape_info, extract_feature_len_ | | This is called at the beginning of | InferBoundShapeAndType()

source

pub fn infer_ops(&mut self, op: &OperatorDef, ws: *mut Workspace)

source

pub fn infer_bound_shape_and_type( &mut self, net: &NetDef, info: &ShapeInfoMap, ws: *mut Workspace, extract_feature_len: Option<bool> )

source

pub fn set_tensor_bound_shape_if_not_exist( &mut self, name: &String, t: &Vec<TensorBoundShape_DimType>, bound_dims: Vec<i64>, type_: TensorProto_DataType, is_quantized: bool ) -> &mut TensorShape

source

pub fn check_and_set_tensor_bound_shape( &mut self, name: &String, t: &Vec<TensorBoundShape_DimType>, bound_dims: Vec<i64>, ty: TensorProto_DataType, is_quantized: bool, allow_existing_shape: Option<bool>, scale: Option<f32>, offset: Option<i32>, in_place_op: Option<bool> ) -> &mut TensorShape

| if allow_existing_shape is true, we use | existing shape directly and not enforce | shape to be equal to bound_dims else we | enforce them to be equal

source

pub fn infer_output( &mut self, op: &OperatorDef, input_shapes: &Vec<TensorShape> ) -> Vec<TensorShape>

source

pub fn infer_given_tensor_fill(&mut self, op: &OperatorDef)

source

pub fn infer_lengths_range_fill(&mut self, op: &OperatorDef)

source

pub fn infer_sparse_lengths_sum_sparse_lookup(&mut self, op: &OperatorDef)

source

pub fn infer_sparse_lengths_sum(&mut self, op: &OperatorDef)

source

pub fn infer_shape(&mut self, op: &OperatorDef)

source

pub fn infer_reshape(&mut self, op: &OperatorDef)

source

pub fn infer_int_8quantize_input(&mut self, op: &OperatorDef)

source

pub fn infer_elementwise_op_input(&mut self, op: &OperatorDef)

source

pub fn infer_concat_inputs(&mut self, op: &OperatorDef)

source

pub fn infer_elementwise_op(&mut self, op: &OperatorDef)

source

pub fn infer_concat(&mut self, op: &OperatorDef)

| For concat net, if some inputs are missing | and we have add_axis argument, it means | that all the inputs should be of the same | dimension. In this case, we can infer the | shape of the missing inputs

source

pub fn inferFC(&mut self, op: &OperatorDef)

source

pub fn infer_quantization_transformation(&mut self, op: &OperatorDef)

| Infers shapes for operators which are used | to transform non-quantized operators | (e.g. SparseLengthsSum) into quantized | operators | | (e.g. SparseLengthsSumFused8BitRowwise) at | model training time. | | If we’re doing quantization for CONSTANTS | (eg. embedding tables), current_dim_type_ | should be set to CONSTANT.

source

pub fn infer_un_pack_records(&mut self, op: &OperatorDef)

source

pub fn infer_tile(&mut self, op: &OperatorDef)

source

pub fn infer_softmax(&mut self, op: &OperatorDef)

source

pub fn infer_lp_norm(&mut self, op: &OperatorDef)

source

pub fn infer_common_op( &mut self, op: &OperatorDef, schema: *const OpSchema, bypass_input_check: Option<bool>, in_place_op: Option<bool> )

| Standard shape/type inference using | op schema registered shape inference | function |

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Ungil for Twhere T: Send,