class ov::pass::MimicSetBatchSize

Overview

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>

class MimicSetBatchSize: public ov::pass::ModelPass
{
public:
    // methods

    "MimicSetBatchSize""0" OPENVINO_RTTI(, );
    virtual boolconst std::shared_ptr<ov::Model>& run_on_model();
};

Inherited Members

public:
    // typedefs

    typedef DiscreteTypeInfo type_info_t;

    // methods

    boolconst PassPropertyMask& get_property() const;
    voidconst std::string& set_name();
    std::string get_name() const;
    voidconst param_callback& set_callback();
    virtual voidconst std::shared_ptr<PassConfig>& set_pass_config();
    std::shared_ptr<PassConfig> get_pass_config();
    boolconst std::shared_ptr<const Node>& transformation_callback();
    virtual const type_info_t& get_type_info() const = 0;
    "ov::pass::ModelPass" OPENVINO_RTTI();
    virtual boolconst std::shared_ptr<ov::Model>& run_on_model() = 0;

Detailed Documentation

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