76{
77
78 if (_input_shape.
rank() != 4 || _filter_shape.
rank() != 4)
79 return false;
80
81 if (_bias_data && _bias_shape.
rank() != 1)
82 return false;
83
84 auto const input_batches = _input_shape.
dim(0).
value();
85 auto const input_height = _input_shape.
dim(1).
value();
86 auto const input_width = _input_shape.
dim(2).
value();
87 auto const input_depth = _input_shape.
dim(3).
value();
88
89 auto const filter_height = _filter_shape.
dim(1).
value();
90 auto const filter_width = _filter_shape.
dim(2).
value();
91 auto const filter_channels_out = _filter_shape.
dim(3).
value();
92
93 if (filter_channels_out % input_depth != 0)
94 return false;
95
96 if (_params.
depth_multiplier !=
static_cast<int32_t
>(filter_channels_out / input_depth))
97 return false;
98
99 if (_bias_shape.
dim(0).
value() != filter_channels_out)
100 return false;
101
102 auto output_height = compute_output(_params.
padding_type, input_height, filter_height,
104 if (output_height < 0)
105 return false;
106
107 auto output_width = compute_output(_params.
padding_type, input_width, filter_width,
109 if (output_width < 0)
110 return false;
111
113
114 _output_shape.
rank(4);
115 _output_shape.
dim(0) = input_batches;
116 _output_shape.
dim(1) = output_height;
117 _output_shape.
dim(2) = output_width;
118 _output_shape.
dim(3) = filter_channels_out;
119
121 compute_padding(output_height, input_height, filter_height, _params.
stride_height,
125
126 return true;
127}
uint32_t value(void) const
Return the value.
const Dimension & dim(uint32_t axis) const
uint32_t rank(void) const
void get_act_minmax(const FusedActFunc act, float &act_min, float &act_max)