Skip to content

Commit

Permalink
Fix typos with copying smart pointers (LLNL#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Moon authored and bvanessen committed Nov 20, 2019
1 parent 8c288e7 commit 615c8e4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/layers/data_type_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ data_type_layer<TensorDataType>::data_type_layer(const data_type_layer<TensorDat
m_gradient_wrt_outputs.reserve(other.m_gradient_wrt_outputs.size());
m_gradient_wrt_inputs.reserve(other.m_gradient_wrt_inputs.size());
for (const auto& ptr : other.m_inputs) {
m_inputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_inputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}
for (const auto& ptr : other.m_outputs) {
m_outputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_outputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}
for (const auto& ptr : other.m_gradient_wrt_outputs) {
m_gradient_wrt_outputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_gradient_wrt_outputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}
for (const auto& ptr : other.m_gradient_wrt_inputs) {
m_gradient_wrt_inputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_gradient_wrt_inputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}

}
Expand All @@ -73,16 +73,16 @@ data_type_layer<TensorDataType>& data_type_layer<TensorDataType>::operator=(cons
m_gradient_wrt_outputs.reserve(other.m_gradient_wrt_outputs.size());
m_gradient_wrt_inputs.reserve(other.m_gradient_wrt_inputs.size());
for (const auto& ptr : other.m_inputs) {
m_inputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_inputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}
for (const auto& ptr : other.m_outputs) {
m_outputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_outputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}
for (const auto& ptr : other.m_gradient_wrt_outputs) {
m_gradient_wrt_outputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_gradient_wrt_outputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}
for (const auto& ptr : other.m_gradient_wrt_inputs) {
m_gradient_wrt_inputs.emplace_back(ptr ? nullptr : ptr->Copy());
m_gradient_wrt_inputs.emplace_back(ptr ? ptr->Copy() : nullptr);
}

return *this;
Expand Down

0 comments on commit 615c8e4

Please sign in to comment.