mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-03 15:51:15 +08:00

* fix slice data size and add tests * fix contiguous flag * simplify stride and perform copy for non-contiguous arrays * fix cpu * comment
22 lines
440 B
C++
22 lines
440 B
C++
// Copyright © 2024 Apple Inc.
|
|
|
|
#pragma once
|
|
|
|
#include "mlx/array.h"
|
|
|
|
namespace mlx::core {
|
|
|
|
std::tuple<bool, int64_t, std::vector<int64_t>> prepare_slice(
|
|
const array& in,
|
|
const std::vector<int>& start_indices,
|
|
const std::vector<int>& strides);
|
|
|
|
void shared_buffer_slice(
|
|
const array& in,
|
|
const std::vector<size_t>& out_strides,
|
|
size_t data_offset,
|
|
size_t data_size,
|
|
array& out);
|
|
|
|
} // namespace mlx::core
|