Skip to content

Commit c3bccb9

Browse files
committed
Responded to final comments
1 parent df5ecc9 commit c3bccb9

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

aten/src/ATen/core/List.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class List final {
353353
* Appends the given list to the end of the container. Uses at most one memory allocation.
354354
* May invalidate any references, pointers, or iterators referring to contained elements. Any past-the-end iterators may also be invalidated.
355355
*/
356-
void append(ListPtr<T> lst) const;
356+
void append(List<T> lst) const;
357357

358358
/**
359359
* Appends the given element value to the end of the container.

aten/src/ATen/core/List_inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void List<T>::push_back(T&& value) const {
182182
}
183183

184184
template<class T>
185-
void ListPtr<T>::append(ListPtr<T> b) const {
185+
void List<T>::append(List<T> b) const {
186186
if (b.use_count() == 1) {
187187
impl_->list.insert(impl_->list.end(), make_move_iterator(b.impl_->list.begin()), make_move_iterator(b.impl_->list.end()));
188188
} else {

torch/csrc/jit/register_prim_ops.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,9 +1536,8 @@ int listAdd(Stack& stack) {
15361536
}
15371537
template <class T>
15381538
int listInplaceAdd(Stack& stack) {
1539-
c10::ListPtr<T> a = c10::make_list<T>();
1540-
c10::ListPtr<T> b = c10::make_list<T>();
1541-
pop(stack, a, b);
1539+
c10::List<T> b = pop(stack).to<List<T>>();
1540+
c10::List<T> a = pop(stack).to<List<T>>();
15421541
a.append(std::move(b));
15431542
push(stack, std::move(a));
15441543
return 0;
@@ -1925,9 +1924,9 @@ RegisterOperators reg2({
19251924
"[]", \
19261925
listAdd<c_type::value_type>), \
19271926
Operator( \
1928-
"aten::add_(" decl_type "[](a!) self, " decl_type "[] b) -> " decl_type \
1927+
"aten::add_(" decl_type "[](a!) self, " decl_type "[] b) -> " decl_type \
19291928
"[]", \
1930-
listInplaceAdd<c_type::value_type>), \
1929+
listInplaceAdd<c_type::value_type>), \
19311930
Operator( \
19321931
"aten::slice(" decl_type \
19331932
"[] l, int start, int end=9223372036854775807, int step=1) -> " decl_type \
@@ -2081,7 +2080,7 @@ RegisterOperators reg2({
20812080
"prim::min(int[] x) -> int",
20822081
[](Stack& stack) {
20832082
c10::List<int64_t> int_list = pop(stack).toIntList();
2084-
int64_t min_element = std::numeric_limits<int64_t>::max();
2083+
int64_t min_element = std::numeric_limits<int64_t>::max();
20852084

20862085
for(int64_t ele: int_list) {
20872086
if(ele < min_element) {

0 commit comments

Comments
 (0)