Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions torch/csrc/jit/register_prim_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,12 +1507,11 @@ int listNe<at::Tensor>(Stack& stack) {
return 0;
}

Operation listList(const Node* node) {
return [=](Stack& stack) {
// Intentional no-op, needed to match Python semantics for list(iterable),
// but in JIT these will already be lists
return 0;
};
template <typename T>
int listList(Stack& stack) {
c10::List<T> a = pop(stack).to<c10::List<T>>();
push(stack, a.copy());
return 0;
}

template <class T>
Expand Down Expand Up @@ -1920,7 +1919,8 @@ RegisterOperators reg2({
"[] l, int start, int end=9223372036854775807, int step=1) -> " decl_type \
"[]", \
listSlice<c_type::value_type>), \
Operator("aten::list(" decl_type "[] l) -> " decl_type "[]", listList), \
Operator("aten::list(" decl_type "[] l) -> " decl_type "[]", \
listList<c_type::value_type>), \
Operator( \
"aten::mul(" decl_type "[] l, int n) -> " decl_type "[]", \
listMulIntLeft<c_type::value_type>), \
Expand Down Expand Up @@ -2068,7 +2068,7 @@ RegisterOperators reg2({
"prim::min(int[] x) -> int",
[](Stack& stack) {
c10::List<int64_t> int_list = pop(stack).toIntList();
int64_t min_element = std::numeric_limits<int64_t>::max();
int64_t min_element = std::numeric_limits<int64_t>::max();

for(int64_t ele: int_list) {
if(ele < min_element) {
Expand Down