| 159 | |
| 160 | template <typename Backend, bool new_axis> |
| 161 | void TensorJoin<Backend, new_axis>::GetInputLayout(const Workspace &ws) { |
| 162 | input_layout_ = {}; |
| 163 | if (new_axis && !has_axis_name_) |
| 164 | return; |
| 165 | |
| 166 | int ninp = this->spec_.NumRegularInput(); |
| 167 | for (int i = 0; i < ninp; i++) { |
| 168 | auto &in = ws.Input<Backend>(0); |
| 169 | TensorLayout tl = in.GetLayout(); |
| 170 | if (!tl.empty()) { |
| 171 | if (!input_layout_.empty()) |
| 172 | DALI_ENFORCE(input_layout_ == tl, make_string("All non-empty input layouts must match.\n" |
| 173 | "Offending values: \"", input_layout_, "\" and \"", tl, "\"")); |
| 174 | |
| 175 | input_layout_ = tl; |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | template <typename Backend, bool new_axis> |
| 181 | void TensorJoin<Backend, new_axis>::SetOutputLayout(const Workspace &ws) { |
no test coverage detected