• Adam Osewski's avatar
    Unify (static) auto-broadcasting helpers. (#4242) · fe054d67
    Adam Osewski authored
    * Helper function get_axes_mapping.
    
    * Enhance Broadcast:v1 NUMPY broadcasting.
    
    - Enable NUMPY broadcasting mechanism to work in bothdirections:
        target_shape <-> arg_shape
    
    * Add opset1:squeeze and fix bug in reading squeezed axis idx.
    
    * Fix and enhance downgrade pass for Broadcast:v1
    
    * Use Broadcast:v1 in ONNX Expand operator.
    
    * Replace Broadcast:v0 with v1 in some helper functions.
    
    * Remove call to deprecated legacy_broadcasting helper function.
    
    * Add helper get_axes_mapping_output function.
    
    * Use directly Broadcast:v1 instead of helper function.
    
    * Get back operators from v0 in helper function.
    
    * Use helper function and some refactoring.
    
    * Add legacy style broadcast helper function for opset1.
    
    * User helper broadcasting function for arithmetic operators.
    
    * Add empty axis only if its size is equal to one.
    
    * Aplly review remarks:
    
    - Rename broadcasting function deleting _values_ infix
    - Remove variables used only once.
    - Use STL library where possible.
    - Remove unnecessary conditions.
    
    * Add helper for Broadcast:v1.
    
    * Fix merge artifact and force unsigned type for argument.
    
    * Review. Add additional check for static output.
    
    * Apply clang-format.
    
    * Fix: call v0 ops in ngraph::builder namespace.
    
    * Move opset1 boradcasting helpers from util/broadcasting.hpp
    
    * Use autobroadcast built-in mechanism for arithmetic operators in RNN.
    
    * Move helper functions to autobroadcast.hpp file.
    
    - Update calls with new namespace ngraph::builder
    - Remove calls using shared_ptr<ngraph::Node> and replace them with
      one accepting Output<ngraph::Node>
    - Some small formatting (remove unnecesary namespace prefix)
    
    * Remove unused function.
    
    * Rename error class to reflect it's NumPy related.
    
    * Fix thrown error name in autobroadcast UT.
    
    * Code refactoring.
    
    - Use one one set of helpers to broadcast node according to NumPy scheme
    
    * Documentation formatting.
    
    * Remove include to deleted header.
    
    * Apply style format.
    
    * Remove std:: prefix.
    
    * Do reshape and/or broadcast only when necessary.
    
    * Remove std:: and ngraph:: prefixes.
    
    * UT for numpy_broadcast_for_matmul and legacy boradcast.
    
    * Rename helper function.
    
    * UT for opset1 legacy broadcast helper function.
    
    * Add more UT for get_axes_mapping and style-format.
    
    * Review comments.
    
    * Restrict if with NGRAPH_WARN to NGRAPH_CHECK.
    Co-authored-by: 's avatarMichał Karzyński <postrational@users.noreply.github.com>
    Co-authored-by: 's avatarSang Ik Lee <sang.ik.lee@intel.com>
    fe054d67
builder_autobroadcast.cpp 17.9 KB