models._infer_shapes_nn_mlmodel

Module Contents

Functions

_get_translator_function(layer_type) Get the right translator function
_identity(layer,shape_dict)
_convolution(layer,shape_dict)
_pooling(layer,shape_dict)
_inner_product(layer,shape_dict)
_embedding(layer,shape_dict)
_crop(layer,shape_dict)
_padding(layer,shape_dict)
_upsample(layer,shape_dict)
_add(layer,shape_dict)
_dot(layer,shape_dict)
_reduce(layer,shape_dict)
_load_constant(layer,shape_dict)
_reshape(layer,shape_dict)
_flatten(layer,shape_dict)
_permute(layer,shape_dict)
_concat(layer,shape_dict)
_split(layer,shape_dict)
_sequence_repeat(layer,shape_dict)
_reorganize_data(layer,shape_dict)
_slice(layer,shape_dict)
_simple_recurrent(layer,shape_dict)
_gru(layer,shape_dict)
_uni_directional_lstm(layer,shape_dict)
_bi_directional_lstm(layer,shape_dict)
infer_shapes(nn_spec,input_spec,input_shape_dict=None) Input:
_get_translator_function(layer_type)

Get the right translator function

_identity(layer, shape_dict)
_convolution(layer, shape_dict)
_pooling(layer, shape_dict)
_inner_product(layer, shape_dict)
_embedding(layer, shape_dict)
_crop(layer, shape_dict)
_padding(layer, shape_dict)
_upsample(layer, shape_dict)
_add(layer, shape_dict)
_dot(layer, shape_dict)
_reduce(layer, shape_dict)
_load_constant(layer, shape_dict)
_reshape(layer, shape_dict)
_flatten(layer, shape_dict)
_permute(layer, shape_dict)
_concat(layer, shape_dict)
_split(layer, shape_dict)
_sequence_repeat(layer, shape_dict)
_reorganize_data(layer, shape_dict)
_slice(layer, shape_dict)
_simple_recurrent(layer, shape_dict)
_gru(layer, shape_dict)
_uni_directional_lstm(layer, shape_dict)
_bi_directional_lstm(layer, shape_dict)
infer_shapes(nn_spec, input_spec, input_shape_dict=None)

Input:

spec : mlmodel spec input_shape_dict: dictionary of string –> tuple

string: input name tuple: input shape as a 5 length tuple in order (Seq, Batch, C, H, W)

If input_shape_dict is not provided, input shapes are inferred from the input description in the mlmodel. Since the description in the specification only contains values of C,H,W; Seq and Batch dimensions are set to 1.

Output:

shape_dict: dictionary containing all the blobs in the neural network and their shapes, expressed as length 5 tuples,
to be interpreted in order (Seq, Batch, C, H, W).