Struct caffe2_opt::BoundShapeInferencer
source · pub struct BoundShapeInferencer { /* private fields */ }
Implementations§
source§impl BoundShapeInferencer
impl BoundShapeInferencer
pub fn new(spec: &BoundShapeSpec) -> Self
pub fn ensure_shape_names(&self, info: *mut HashMap<String, ShapeInfo>)
sourcepub fn initialize(&mut self, info: &ShapeInfoMap, extract_feature_len: bool)
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()
pub fn infer_ops(&mut self, op: &OperatorDef, ws: *mut Workspace)
pub fn infer_bound_shape_and_type( &mut self, net: &NetDef, info: &ShapeInfoMap, ws: *mut Workspace, extract_feature_len: Option<bool> )
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
sourcepub 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
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
pub fn infer_output( &mut self, op: &OperatorDef, input_shapes: &Vec<TensorShape> ) -> Vec<TensorShape>
pub fn infer_given_tensor_fill(&mut self, op: &OperatorDef)
pub fn infer_lengths_range_fill(&mut self, op: &OperatorDef)
pub fn infer_sparse_lengths_sum_sparse_lookup(&mut self, op: &OperatorDef)
pub fn infer_sparse_lengths_sum(&mut self, op: &OperatorDef)
pub fn infer_shape(&mut self, op: &OperatorDef)
pub fn infer_reshape(&mut self, op: &OperatorDef)
pub fn infer_int_8quantize_input(&mut self, op: &OperatorDef)
pub fn infer_elementwise_op_input(&mut self, op: &OperatorDef)
pub fn infer_concat_inputs(&mut self, op: &OperatorDef)
pub fn infer_elementwise_op(&mut self, op: &OperatorDef)
sourcepub fn infer_concat(&mut self, op: &OperatorDef)
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
pub fn inferFC(&mut self, op: &OperatorDef)
sourcepub fn infer_quantization_transformation(&mut self, op: &OperatorDef)
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.
pub fn infer_un_pack_records(&mut self, op: &OperatorDef)
pub fn infer_tile(&mut self, op: &OperatorDef)
pub fn infer_softmax(&mut self, op: &OperatorDef)
pub fn infer_lp_norm(&mut self, op: &OperatorDef)
Auto Trait Implementations§
impl RefUnwindSafe for BoundShapeInferencer
impl Send for BoundShapeInferencer
impl Sync for BoundShapeInferencer
impl Unpin for BoundShapeInferencer
impl UnwindSafe for BoundShapeInferencer
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.