"example/38_permute/run_permute_bundle_example.inc" did not exist on "e81f54bbb9d124e2be97baeb92b0054628aabcb4"
Unverified Commit a8d86615 authored by Cagri Eryilmaz's avatar Cagri Eryilmaz Committed by GitHub
Browse files

check for divisor encodable or not, fallback if needed (#906)

* check for divisor encodable or not, fallback if needed

* verify test for retinaface case
parent 29fa2666
......@@ -352,7 +352,8 @@ bool broadcastable(bool& divisible_by_4,
auto b_len = result.get_shape().lens()[b_idx];
auto b_stride = result.get_shape().strides()[b_idx];
assert(bshape.lens()[b_idx] == b_len);
if(b_len <= max_size and std::none_of(std::next(b_it), strides.end(), not_zero))
if(b_len <= max_size and std::none_of(std::next(b_it), strides.end(), not_zero) and
is_divisor_encodable(b_stride * b_len))
{
divisible_by_4 = (b_len % 4 == 0) and (b_stride % 4 == 0) and
......
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/instruction.hpp>
struct test_add_broadcast6 : verify_program<test_add_broadcast6>
{
migraphx::program create_program() const
{
migraphx::program p;
auto* mm = p.get_main_module();
auto x = mm->add_parameter("x", {migraphx::shape::float_type, {1, 64, 568, 1328}});
auto y = mm->add_parameter("y", {migraphx::shape::float_type, {64}});
auto by = mm->add_instruction(
migraphx::make_op("broadcast", {{"axis", 1}, {"dims", {1, 64, 568, 1328}}}), y);
mm->add_instruction(migraphx::make_op("add"), x, by);
return p;
}
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment