Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
awni committed Sep 26, 2024
1 parent c76a16f commit 2dbda67
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mlx/backend/common/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ void copy_general_general(
const std::vector<StrideT>& o_strides,
int64_t i_offset,
int64_t o_offset) {
if (data_shape.empty()) {
auto val = static_cast<DstT>(*(src.data<SrcT>() + i_offset));
auto dst_ptr = dst.data<DstT>() + o_offset;
*dst_ptr = val;
return;
}
auto [shape, strides] = collapse_contiguous_dims(
data_shape, std::vector<std::vector<StrideT>>{i_strides, o_strides});
auto src_ptr = src.data<SrcT>() + i_offset;
Expand Down

0 comments on commit 2dbda67

Please sign in to comment.