| 39 | |
| 40 | template <int ndim, int channel_dim> |
| 41 | void PerturbAndValidate( |
| 42 | BlockSetup<ndim, channel_dim> &setup, |
| 43 | TensorListShape<ndim + (channel_dim >= 0)> shape, |
| 44 | const TensorListShape<ndim + (channel_dim >= 0)> in_shape, |
| 45 | span<TensorShape<ndim>> sizes) { |
| 46 | constexpr int tensor_ndim = BlockSetup<ndim, channel_dim>::tensor_ndim; |
| 47 | EXPECT_NO_THROW(setup.ValidateOutputShape(shape, in_shape, sizes)); |
| 48 | for (int i = 0; i < shape.num_samples(); i++) { |
| 49 | for (int d = 0; d < tensor_ndim; d++) { |
| 50 | shape.tensor_shape_span(i)[d]++; |
| 51 | EXPECT_THROW(setup.ValidateOutputShape(shape, in_shape, sizes), std::exception); |
| 52 | shape.tensor_shape_span(i)[d]--; |
| 53 | EXPECT_NO_THROW(setup.ValidateOutputShape(shape, in_shape, sizes)); |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | TEST(BlockSetup, GetOutputShape_DHWC) { |
| 59 | BlockSetup<3, 3> setup; // DHWC |
no test coverage detected