27 #ifndef LBANN_LAYERS_IMAGE_BILINEAR_RESIZE_HPP_INCLUDED 28 #define LBANN_LAYERS_IMAGE_BILINEAR_RESIZE_HPP_INCLUDED 33 #include "lbann/proto/layers.pb.h" 42 template <
typename TensorDataType, data_layout Layout, El::Device Device>
46 "bilinear_resize_layer only supports DATA_PARALLEL");
61 template <
typename ArchiveT>
66 std::string
get_type()
const override {
return "bilinear resize"; }
94 template <
typename T, data_layout L, El::Device D>
96 lbann_data::Layer& proto)
const 98 proto.set_datatype(proto::ProtoDataType<T>);
99 auto* msg = proto.mutable_bilinear_resize();
104 #ifndef LBANN_BILINEAR_RESIZE_LAYER_INSTANTIATE 105 #define PROTO_DEVICE(T, Device) \ 106 extern template class bilinear_resize_layer<T, \ 107 data_layout::DATA_PARALLEL, \ 112 #endif // LBANN_BILINEAR_RESIZE_LAYER_INSTANTIATE 116 #endif // LBANN_LAYERS_IMAGE_BILINEAR_RESIZE_HPP_INCLUDED
std::string get_type() const override
Get the layer type's name.
void fp_compute() override
Apply layer operation. Called by the 'forward_prop' function. Given the input tensors, the output tensors are populated with computed values.
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
Resize image with bilinear interpolation.
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
constexpr El::Device Device
bilinear_resize_layer(lbann_comm *comm, El::Int height, El::Int width)
void write_specific_proto(lbann_data::Layer &proto) const final
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 serialize(ArchiveT &ar)
data_layout
Data layout that is optimized for different modes of parallelism.
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
friend class cereal::access
bilinear_resize_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...