Turi Create  4.0
mlc_utils.hpp
1 /* Copyright © 2020 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at
5  * https://opensource.org/licenses/BSD-3-Clause
6  */
7 
8 #pragma once
9 
10 #import <MLCompute/MLCompute.h>
11 
12 #include <ml/neural_net/mps_utils.h>
13 
14 namespace turi {
15 namespace neural_net {
16 
17 NSData *convert_hwc_array_to_chw_data(const float_array &arr);
18 
19 shared_float_array convert_chw_data_to_hwc_array(NSData *data, std::vector<size_t> hwc_shape);
20 
21 NSData *copy_data(const float_array &arr);
22 
23 } // namespace neural_net
24 } // namespace turi