|
1 |
| -#include <ATen/core/ivalue.h> |
2 | 1 | #include <ATen/core/Dict.h>
|
3 | 2 | #include <ATen/core/Formatting.h>
|
4 | 3 | #include <ATen/core/class_type.h>
|
5 | 4 | #include <ATen/core/enum_type.h>
|
6 | 5 | #include <ATen/core/function.h>
|
| 6 | +#include <ATen/core/ivalue.h> |
7 | 7 | #include <ATen/core/jit_type.h>
|
8 | 8 | #include <ATen/core/stack.h>
|
9 | 9 | #include <ATen/core/type_factory.h>
|
10 |
| -#include <c10/util/irange.h> |
11 | 10 | #include <c10/util/StringUtil.h>
|
12 | 11 | #include <c10/util/hash.h>
|
| 12 | +#include <c10/util/irange.h> |
13 | 13 | #include <cmath>
|
14 | 14 | #include <iostream>
|
| 15 | +#include <utility> |
15 | 16 |
|
16 | 17 | namespace c10 {
|
17 | 18 | bool _fastEqualsForContainer(const IValue& lhs, const IValue& rhs) {
|
@@ -492,11 +493,11 @@ std::ostream& printMaybeAnnotatedList(
|
492 | 493 | if (the_list.toListRef().size() == 0 ||
|
493 | 494 | !elementTypeCanBeInferredFromMembers(list_elem_type)) {
|
494 | 495 | out << "annotate(" << the_list.type<c10::Type>()->annotation_str() << ", ";
|
495 |
| - printList(out, the_list.toListRef(), "[", "]", formatter); |
| 496 | + printList(out, the_list.toListRef(), "[", "]", std::move(formatter)); |
496 | 497 | out << ")";
|
497 | 498 | return out;
|
498 | 499 | } else {
|
499 |
| - return printList(out, the_list.toListRef(), "[", "]", formatter); |
| 500 | + return printList(out, the_list.toListRef(), "[", "]", std::move(formatter)); |
500 | 501 | }
|
501 | 502 | }
|
502 | 503 |
|
@@ -533,9 +534,9 @@ std::ostream& printMaybeAnnotatedDict(
|
533 | 534 | if (the_dict.toGenericDict().size() == 0 ||
|
534 | 535 | !elementTypeCanBeInferredFromMembers(value_type)) {
|
535 | 536 | out << "annotate(" << the_dict.type<c10::Type>()->annotation_str() << ",";
|
536 |
| - printDict(out, the_dict.toGenericDict(), formatter) << ")"; |
| 537 | + printDict(out, the_dict.toGenericDict(), std::move(formatter)) << ")"; |
537 | 538 | } else {
|
538 |
| - return printDict(out, the_dict.toGenericDict(), formatter); |
| 539 | + return printDict(out, the_dict.toGenericDict(), std::move(formatter)); |
539 | 540 | }
|
540 | 541 | return out;
|
541 | 542 | }
|
@@ -873,7 +874,7 @@ IValue IValue::deepcopy(
|
873 | 874 | for (const auto& e : toTupleRef().elements()) {
|
874 | 875 | copied_tuple.push_back(e.deepcopy(memo));
|
875 | 876 | }
|
876 |
| - copy = IValue(ivalue::Tuple::create(copied_tuple)); |
| 877 | + copy = IValue(ivalue::Tuple::create(std::move(copied_tuple))); |
877 | 878 | }
|
878 | 879 | break;
|
879 | 880 | case IValue::Tag::GenericList: {
|
@@ -1033,7 +1034,7 @@ WeakTypePtr WeakOrStrongTypePtr::asWeakTypePtr() const {
|
1033 | 1034 | } else {
|
1034 | 1035 | std::weak_ptr<torch::jit::CompilationUnit> weak_cu =
|
1035 | 1036 | cu_.getStrongRefOrThrow();
|
1036 |
| - return WeakTypePtr(weak_cu, type_); |
| 1037 | + return WeakTypePtr(std::move(weak_cu), type_); |
1037 | 1038 | }
|
1038 | 1039 | }
|
1039 | 1040 |
|
|
0 commit comments