| 42 | std::string name() const { return "dnnl::binary"; } |
| 43 | |
| 44 | shape compute_shape(std::vector<shape> inputs) const |
| 45 | { |
| 46 | // Compensate for allocation |
| 47 | inputs.pop_back(); |
| 48 | check_shapes{this->trim_post_op_inputs(inputs), *this}.has(2); |
| 49 | auto s0 = inputs.at(0); |
| 50 | auto s1 = inputs.at(1); |
| 51 | auto r = s0; |
| 52 | if(s0 != s1 or not s0.packed()) |
| 53 | { |
| 54 | if(s0.packed() != s1.packed()) |
| 55 | { |
| 56 | r = s0.packed() ? s0 : s1; |
| 57 | } |
| 58 | else if(s0.broadcasted() != s1.broadcasted()) |
| 59 | { |
| 60 | r = s0.broadcasted() ? s1.with_lens(s0.lens()) : s0.with_lens(s0.lens()); |
| 61 | } |
| 62 | else |
| 63 | { |
| 64 | r = {s0.type(), s0.lens()}; |
| 65 | } |
| 66 | } |
| 67 | // Call to get_primitive to make sure an algo is available |
| 68 | this->get_primitive(this->to_memory_desc(r, inputs)); |
| 69 | return r; |
| 70 | } |
| 71 | |
| 72 | dnnl::binary::desc get_desc(const std::unordered_map<int, dnnl::memory::desc>& m) const |
| 73 | { |
nothing calls this directly
no test coverage detected