| 44 | } |
| 45 | |
| 46 | static TensorListShape<> GetOutputShape(const TensorListShape<> &input_shape, |
| 47 | const std::vector<int> &element_map, |
| 48 | const TensorLayout& input_layout) { |
| 49 | if (!input_layout.empty()) { |
| 50 | DALI_ENFORCE( |
| 51 | VideoLayoutInfo::IsSequence(input_layout), |
| 52 | make_string("Input layout must describe a sequence - it must start with 'F', got '", |
| 53 | input_layout, "' instead.")); |
| 54 | } |
| 55 | |
| 56 | DALI_ENFORCE(input_shape.sample_dim() > 1, |
| 57 | "Input must have at least two dimensions - outermost for sequence and at least " |
| 58 | "one for data elements."); |
| 59 | |
| 60 | for (int i = 0; i < input_shape.num_samples(); ++i) { |
| 61 | auto shape = input_shape.tensor_shape_span(i); |
| 62 | CheckInputShape(shape, element_map); |
| 63 | } |
| 64 | return input_shape.last(input_shape.sample_dim() - 1); |
| 65 | } |
| 66 | |
| 67 | } // namespace detail |
| 68 |
no test coverage detected