File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
dpctl/tensor/libtensor/source Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ void copy_numpy_ndarray_into_usm_ndarray(
84
84
const py::ssize_t *dst_shape = dst.get_shape_raw ();
85
85
bool shapes_equal (true );
86
86
size_t src_nelems (1 );
87
- for (int i = 0 ; i < src_ndim; ++i) {
87
+ for (int i = 0 ; shapes_equal && ( i < src_ndim) ; ++i) {
88
88
shapes_equal = shapes_equal && (src_shape[i] == dst_shape[i]);
89
89
src_nelems *= static_cast <size_t >(src_shape[i]);
90
90
}
@@ -114,7 +114,7 @@ void copy_numpy_ndarray_into_usm_ndarray(
114
114
py::detail::array_descriptor_proxy (npy_src.dtype ().ptr ())->type_num ;
115
115
int dst_typenum = dst.get_typenum ();
116
116
117
- auto array_types = td_ns::usm_ndarray_types ();
117
+ const auto & array_types = td_ns::usm_ndarray_types ();
118
118
int src_type_id = array_types.typenum_to_lookup_id (src_typenum);
119
119
int dst_type_id = array_types.typenum_to_lookup_id (dst_typenum);
120
120
You can’t perform that action at this time.
0 commit comments