MCPcopy Create free account
hub / github.com/LBANN/lbann / write_specific_proto

Method write_specific_proto

src/layers/learning/convolution.cpp:232–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230
231template <typename T, data_layout L, El::Device D>
232void convolution_layer<T, L, D>::write_specific_proto(
233 lbann_data::Layer& proto) const
234{
235 proto.set_datatype(proto::ProtoDataType<T>);
236 auto* msg = proto.mutable_convolution();
237 msg->set_num_dims(this->get_conv_dims().size());
238 msg->set_out_channels(this->m_output_channels);
239 protobuf::assign_to_repeated(*msg->mutable_kernel_size(),
240 this->get_kernel_dims());
241 protobuf::assign_to_repeated(*msg->mutable_stride(), this->get_strides());
242 protobuf::assign_to_repeated(*msg->mutable_padding(), this->get_pads());
243 msg->mutable_groups()->set_value(this->m_groups);
244 auto const has_bias = (this->num_weights() > 1UL);
245 msg->mutable_has_bias()->set_value(has_bias);
246 protobuf::assign_to_repeated(*msg->mutable_dilation(), this->get_dilations());
247#ifdef LBANN_HAS_DNN_LIB
248 msg->set_conv_tensor_op_mode(
249 dnn_lib::convert_to_proto_math_type(this->m_convolution_math_type));
250#endif // LBANN_HAS_DNN_LIB
251}
252
253#if defined LBANN_HAS_DISTCONV
254template <typename TensorDataType, data_layout Layout, El::Device Device>

Callers

nothing calls this directly

Calls 5

get_kernel_dimsMethod · 0.95
set_valueMethod · 0.80
num_weightsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected