Enable performance-unnecessary-value-param in .clang-tidy (#15026)
authorPeter Goldsborough <psag@fb.com>
Fri, 14 Dec 2018 00:09:08 +0000 (16:09 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 14 Dec 2018 00:15:35 +0000 (16:15 -0800)
commit1e9c384afb094afde5b4dd8800e3521cd12bc0fd
tree6feef1bcbe60aeab419ca75cd498bff74127c564
parentbdfff2f8c28faa71e8323ee5cb8a4957679e581c
Enable performance-unnecessary-value-param in .clang-tidy (#15026)

Summary:
This PR fixes around 250 places in the codebase where we were making unnecessary copies of objects (some large, some small).

ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15026

Differential Revision: D13458784

Pulled By: goldsborough

fbshipit-source-id: be5148b2ce09493588d70952e6f6d6ff5ec5199b
78 files changed:
.clang-tidy
test/cpp/api/module.cpp
tools/run-clang-tidy-in-ci.sh
torch/csrc/Exceptions.h
torch/csrc/api/include/torch/nn/cloneable.h
torch/csrc/api/include/torch/nn/module.h
torch/csrc/api/include/torch/nn/modules/batchnorm.h
torch/csrc/api/include/torch/nn/modules/conv.h
torch/csrc/api/include/torch/nn/modules/dropout.h
torch/csrc/api/include/torch/nn/modules/embedding.h
torch/csrc/api/include/torch/nn/modules/linear.h
torch/csrc/api/include/torch/nn/modules/rnn.h
torch/csrc/api/include/torch/nn/modules/sequential.h
torch/csrc/api/src/nn/module.cpp
torch/csrc/api/src/nn/modules/batchnorm.cpp
torch/csrc/api/src/nn/modules/conv.cpp
torch/csrc/api/src/nn/modules/dropout.cpp
torch/csrc/api/src/nn/modules/embedding.cpp
torch/csrc/api/src/nn/modules/linear.cpp
torch/csrc/api/src/nn/modules/rnn.cpp
torch/csrc/api/src/serialize/input-archive.cpp
torch/csrc/autograd/VariableTypeUtils.h
torch/csrc/autograd/engine.cpp
torch/csrc/autograd/functions/basic_ops.h
torch/csrc/autograd/functions/pybind.h
torch/csrc/autograd/functions/utils.cpp
torch/csrc/autograd/functions/utils.h
torch/csrc/autograd/python_cpp_function.cpp
torch/csrc/autograd/python_cpp_function.h
torch/csrc/autograd/python_function.cpp
torch/csrc/autograd/variable.h
torch/csrc/jit/batched/BatchTensor.cpp
torch/csrc/jit/batched/BatchTensor.h
torch/csrc/jit/constants.cpp
torch/csrc/jit/constants.h
torch/csrc/jit/fuser/codegen.cpp
torch/csrc/jit/fuser/kernel_spec.h
torch/csrc/jit/fuser/tensor_desc.h
torch/csrc/jit/hooks_for_testing.cpp
torch/csrc/jit/import_method.cpp
torch/csrc/jit/ir.cpp
torch/csrc/jit/ir.h
torch/csrc/jit/operator.cpp
torch/csrc/jit/passes/alias_analysis.cpp
torch/csrc/jit/passes/alias_analysis.h
torch/csrc/jit/passes/create_autodiff_subgraphs.cpp
torch/csrc/jit/passes/create_autodiff_subgraphs.h
torch/csrc/jit/passes/dead_code_elimination.cpp
torch/csrc/jit/passes/python_print.cpp
torch/csrc/jit/passes/remove_inplace_ops.cpp
torch/csrc/jit/passes/remove_inplace_ops.h
torch/csrc/jit/passes/shape_analysis.cpp
torch/csrc/jit/passes/shape_analysis.h
torch/csrc/jit/passes/to_batch.cpp
torch/csrc/jit/passes/to_batch.h
torch/csrc/jit/passes/utils/check_alias_annotation.cpp
torch/csrc/jit/passes/utils/check_alias_annotation.h
torch/csrc/jit/pybind_utils.h
torch/csrc/jit/python_tracer.cpp
torch/csrc/jit/python_tracer.h
torch/csrc/jit/register_prim_ops.cpp
torch/csrc/jit/scope.h
torch/csrc/jit/script/compiler.cpp
torch/csrc/jit/script/compiler.h
torch/csrc/jit/script/init.cpp
torch/csrc/jit/script/lexer.cpp
torch/csrc/jit/script/lexer.h
torch/csrc/jit/script/module.cpp
torch/csrc/jit/script/module.h
torch/csrc/jit/script/parser.h
torch/csrc/jit/script/tree.h
torch/csrc/jit/script/tree_views.h
torch/csrc/jit/symbolic_variable.h
torch/csrc/jit/tracer.cpp
torch/csrc/jit/tracing_state.h
torch/csrc/utils/invalid_arguments.cpp
torch/csrc/utils/pybind.h
torch/csrc/utils/tensor_new.cpp