Skip to content

Commit a685dcd

Browse files
more python, less c++
1 parent 6a5e4bd commit a685dcd

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

include/tensor_bind.cc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,7 @@ Tensor python_tuple_slice(const Tensor& t, pybind11::tuple tuple_slice)
7575
}
7676
);
7777
}
78-
79-
#ifdef __GNUC__
80-
struct
81-
{
82-
const Tensor::Slice* it;
83-
std::size_t sz;
84-
} test;
85-
test.it = t_slices.data();
86-
test.sz = t_slices.size();
87-
std::initializer_list<Tensor::Slice>& t_slice_list = reinterpret_cast<std::initializer_list<Tensor::Slice>&>(test);
88-
#endif
89-
return t[t_slice_list];
78+
return t[tensor_array::wrapper::initializer_wrapper(t_slices.begin().operator->(), t_slices.end().operator->())];
9079
}
9180

9281
Tensor python_slice(const Tensor& t, pybind11::slice py_slice)

0 commit comments

Comments
 (0)