mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Added formatter structure and a boolean value formatter (#354)
* added formatter structure and a boolean value formatter --------- Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
18
mlx/utils.h
18
mlx/utils.h
@@ -9,6 +9,24 @@
|
||||
|
||||
namespace mlx::core {
|
||||
|
||||
struct PrintFormatter {
|
||||
inline void print(std::ostream& os, bool val);
|
||||
inline void print(std::ostream& os, int16_t val);
|
||||
inline void print(std::ostream& os, uint16_t val);
|
||||
inline void print(std::ostream& os, int32_t val);
|
||||
inline void print(std::ostream& os, uint32_t val);
|
||||
inline void print(std::ostream& os, int64_t val);
|
||||
inline void print(std::ostream& os, uint64_t val);
|
||||
inline void print(std::ostream& os, float16_t val);
|
||||
inline void print(std::ostream& os, bfloat16_t val);
|
||||
inline void print(std::ostream& os, float val);
|
||||
inline void print(std::ostream& os, complex64_t val);
|
||||
|
||||
bool capitalize_bool{false};
|
||||
};
|
||||
|
||||
extern PrintFormatter global_formatter;
|
||||
|
||||
/** The type from promoting the arrays' types with one another. */
|
||||
Dtype result_type(const std::vector<array>& arrays);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user