27 #ifndef LBANN_LAYERS_LOSS_CATEGORICAL_ACCURACY_IMPL_HPP_INCLUDED 28 #define LBANN_LAYERS_LOSS_CATEGORICAL_ACCURACY_IMPL_HPP_INCLUDED 35 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
39 this->set_output_dims({1});
42 if (this->get_input_dims(0) != this->get_input_dims(1)) {
43 const auto& parents = this->get_parent_layers();
44 std::stringstream err;
45 err << get_type() <<
" layer \"" << this->get_name() <<
"\" " 46 <<
"has input tensors with different dimensions (";
47 for (
int i = 0; i < this->get_num_parents(); ++i) {
48 const auto& dims = this->get_input_dims(i);
49 err << (i > 0 ?
", " :
"") <<
"layer \"" << parents[i]->get_name()
51 for (
size_t j = 0; j < dims.size(); ++j) {
52 err << (j > 0 ?
" x " :
"") << dims[j];
62 #endif // LBANN_LAYERS_LOSS_CATEGORICAL_ACCURACY_IMPL_HPP_INCLUDED virtual void setup_dims()
Setup tensor dimensions Called by the 'setup' function. If there are any input tensors, the base method sets all uninitialized output tensor dimensions equal to the first input tensor dimensions.
void setup_dims() override
Setup tensor dimensions Called by the 'setup' function. If there are any input tensors, the base method sets all uninitialized output tensor dimensions equal to the first input tensor dimensions.