22{
26 {
28 }
29 else
30 {
31
34 uint32_t maxDims = std::max(numberOfDims1, numberOfDims2);
35 out->
dimensions = std::vector<uint32_t>(maxDims);
36 for (uint32_t i = 1; i <= maxDims; i++)
37 {
38 uint32_t dim1 = 1;
39 if (i <= numberOfDims1)
40 {
42 }
43 uint32_t dim2 = 1;
44 if (i <= numberOfDims2)
45 {
47 }
48 if (dim1 != dim2 && dim1 != 1 && dim2 != 1)
49 {
50 LOG(ERROR) <<
"Dimensions mismatch for BroadcastDiv";
51 return false;
52 }
53 out->
dimensions[maxDims - i] = std::max(dim1, dim2);
54 }
55 }
56 return true;
57}
bool SetShape(const Shape &in, Shape *out)
uint32_t getSizeOfDimension(const Shape &shape, uint32_t dimensionIdx)
bool SameShape(const Shape &in1, const Shape &in2)
uint32_t getNumberOfDimensions(const Shape &shape)
std::vector< uint32_t > dimensions