MCPcopy Create free account
hub / github.com/NVIDIA/DALI / GetOutputShape

Function GetOutputShape

dali/operators/sequence/element_extract.h:46–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

SetupImplMethod · 0.70
SetupOutputLayoutMethod · 0.50

Calls 7

CheckInputShapeFunction · 0.85
make_stringFunction · 0.50
emptyMethod · 0.45
sample_dimMethod · 0.45
num_samplesMethod · 0.45
tensor_shape_spanMethod · 0.45
lastMethod · 0.45

Tested by

no test coverage detected