Remove unnecessary copy/move constructor/operators.
This commit is contained in:
@@ -58,18 +58,6 @@ class DropoutType : public Layer<InputType, OutputType>
|
||||
*/
|
||||
DropoutType(const double ratio = 0.5);
|
||||
|
||||
//! Copy Constructor.
|
||||
DropoutType(const DropoutType& layer);
|
||||
|
||||
//! Move Constructor.
|
||||
DropoutType(const DropoutType&&);
|
||||
|
||||
//! Copy assignment operator.
|
||||
DropoutType& operator=(const DropoutType& layer);
|
||||
|
||||
//! Move assignment operator.
|
||||
DropoutType& operator=(DropoutType&& layer);
|
||||
|
||||
//! Clone the DropoutType object. This handles polymorphism correctly.
|
||||
DropoutType* Clone() const { return new DropoutType(*this); }
|
||||
|
||||
|
||||
@@ -28,50 +28,6 @@ DropoutType<InputType, OutputType>::DropoutType(
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
template<typename InputType, typename OutputType>
|
||||
DropoutType<InputType, OutputType>::DropoutType(
|
||||
const DropoutType& layer) :
|
||||
ratio(layer.ratio),
|
||||
scale(layer.scale)
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
template<typename InputType, typename OutputType>
|
||||
DropoutType<InputType, OutputType>::DropoutType(
|
||||
const DropoutType&& layer) :
|
||||
ratio(std::move(layer.ratio)),
|
||||
scale(std::move(scale))
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
template<typename InputType, typename OutputType>
|
||||
DropoutType<InputType, OutputType>& DropoutType<InputType, OutputType>::
|
||||
operator=(const DropoutType& layer)
|
||||
{
|
||||
if (this != &layer)
|
||||
{
|
||||
ratio = layer.ratio;
|
||||
scale = layer.scale;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename InputType, typename OutputType>
|
||||
DropoutType<InputType, OutputType>& DropoutType<InputType, OutputType>::
|
||||
operator=(DropoutType&& layer)
|
||||
{
|
||||
if (this != &layer)
|
||||
{
|
||||
ratio = std::move(layer.ratio);
|
||||
scale = std::move(layer.scale);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename InputType, typename OutputType>
|
||||
void DropoutType<InputType, OutputType>::Forward(
|
||||
const InputType& input,
|
||||
|
||||
Reference in New Issue
Block a user