mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Fix return-type-is-always-copy warning (#47279)
Summary: `std::vector<bool>` can not return values by reference, since they are stored as bit fields Pull Request resolved: https://github.com/pytorch/pytorch/pull/47279 Reviewed By: glaringlee Differential Revision: D24705188 Pulled By: malfet fbshipit-source-id: 96e71cc4b9881f92af3b4a508d397deab6d68174
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a341a4329a
commit
c05ee86edd
@ -2097,8 +2097,8 @@ TEST_F(ModulesTest, TripletMarginWithDistanceLossDefaultParity) {
|
||||
|
||||
for (auto& reduction : reductions) {
|
||||
for (auto& margin : margins) {
|
||||
for (const auto& swap : swaps) {
|
||||
auto anchor =
|
||||
for (const auto swap : swaps) {
|
||||
auto anchor =
|
||||
torch::randn({100, 128}, torch::dtype(torch::kFloat).requires_grad(true));
|
||||
auto positive =
|
||||
torch::randn({100, 128}, torch::dtype(torch::kFloat).requires_grad(true));
|
||||
@ -2158,7 +2158,7 @@ TEST_F(ModulesTest, TripletMarginWithDistanceLossFunctionalParity) {
|
||||
for (auto& function : distance_functions) {
|
||||
for (auto& reduction : reductions) {
|
||||
for (auto& margin : margins) {
|
||||
for (const auto& swap : swaps) {
|
||||
for (const auto swap : swaps) {
|
||||
auto moduleOptions =
|
||||
TripletMarginWithDistanceLossOptions()
|
||||
.distance_function(function)
|
||||
|
Reference in New Issue
Block a user