Public Member Functions | Data Fields
ngraph::pass::MimicSetBatchSize Class Reference

MimicSetBatchSize transformation relaxes hard-coded output batch dimension of Reshape operation. For Reshape with input shape [in_batch, ...] and pattern value [out_batch, ...] it generates a sub-graph which basically keeps ratio of input and output batch size and performs the following calculation: More...

#include <mimic_set_batch_size.hpp>

Inheritance diagram for ngraph::pass::MimicSetBatchSize:

Public Member Functions

bool run_on_function (std::shared_ptr< ngraph::Function > f) override
 

Data Fields

 NGRAPH_RTTI_DECLARATION
 

Detailed Description

MimicSetBatchSize transformation relaxes hard-coded output batch dimension of Reshape operation. For Reshape with input shape [in_batch, ...] and pattern value [out_batch, ...] it generates a sub-graph which basically keeps ratio of input and output batch size and performs the following calculation:

scale = float(out_batch) / float(in_batch) modified_batch_dim = int(ceil(float(shape(input)[0]) * scale))

This transformation should be executed only while setBatchSize method call


The documentation for this class was generated from the following file: