27 #ifndef LBANN_LAYERS_MISC_COVARIANCE_IMPL_HPP_INCLUDED 28 #define LBANN_LAYERS_MISC_COVARIANCE_IMPL_HPP_INCLUDED 35 template <
typename TensorDataType, data_layout Layout, El::Device Device>
37 size_t max_mini_batch_size)
40 auto dist_data = this->get_prev_activations().DistData();
41 dist_data.colDist = El::STAR;
42 m_means.reset(AbsDistMatrixType::Instantiate(dist_data));
43 m_workspace.reset(AbsDistMatrixType::Instantiate(dist_data));
46 template <
typename TensorDataType, data_layout Layout, El::Device Device>
50 this->set_output_dims({1});
51 if (this->get_input_dims(0) != this->get_input_dims(1)) {
52 const auto& parents = this->get_parent_layers();
53 std::stringstream err;
54 err << get_type() <<
" layer \"" << this->get_name() <<
"\" " 55 <<
"has input tensors with different dimensions (";
56 for (
int i = 0; i < this->get_num_parents(); ++i) {
57 const auto& dims = this->get_input_dims(i);
58 err << (i > 0 ?
", " :
"") <<
"layer \"" << parents[i]->get_name()
60 for (
size_t j = 0; j < dims.size(); ++j) {
61 err << (j > 0 ?
" x " :
"") << dims[j];
71 #endif // LBANN_LAYERS_MISC_COVARIANCE_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.
void setup_data(size_t max_mini_batch_size) override
Setup layer data. Called by the 'setup' function. Memory is allocated for distributed matrices...
void setup_data(size_t max_mini_batch_size) override