Turi Create  4.0
quantization_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 https://opensource.org/licenses/BSD-3-Clause
5  */
6 
7 #pragma once
8 
9 #include <vector>
10 
11 #include <core/util/Span.hpp>
12 #include <ml/neural_net/float16.h>
13 
14 namespace turi {
15 namespace neural_net {
16 
17 #ifdef TURI_USE_FLOAT16
18 
19 bool is_convertible_to_fp16(Span<const float> output);
20 
21 std::vector<__fp16> get_half_precision_weights(Span<const float> output);
22 
23 #endif
24 
25 } // namespace neural_net
26 } // namespace turi