remove unreasonable set to nullptr and other unnecessaries
This commit is contained in:
@@ -51,13 +51,10 @@ NoisyLinear<InputDataType, OutputDataType>::NoisyLinear(
|
||||
template<typename InputDataType, typename OutputDataType>
|
||||
NoisyLinear<InputDataType, OutputDataType>::NoisyLinear(
|
||||
NoisyLinear&& layer) :
|
||||
inSize(std::move(layer.inSize)),
|
||||
outSize(std::move(layer.outSize)),
|
||||
inSize(layer.inSize),
|
||||
outSize(layer.outSize),
|
||||
weights(std::move(layer.weights))
|
||||
{
|
||||
layer.inSize = 0;
|
||||
layer.outSize = 0;
|
||||
layer.weights = nullptr;
|
||||
Reset();
|
||||
}
|
||||
|
||||
@@ -81,12 +78,9 @@ NoisyLinear<InputDataType, OutputDataType>::operator=(NoisyLinear&& layer)
|
||||
{
|
||||
if (this != &layer)
|
||||
{
|
||||
inSize = std::move(layer.inSize);
|
||||
layer.inSize = 0;
|
||||
outSize = std::move(layer.outSize);
|
||||
layer.outSize = 0;
|
||||
inSize = layer.inSize;
|
||||
outSize = layer.outSize;
|
||||
weights = std::move(layer.weights);
|
||||
layer.weights = nullptr;
|
||||
Reset();
|
||||
}
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user