Skip to content

Commit

Permalink
Function name style
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Dec 10, 2024
1 parent 7f527f0 commit f9d90c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mlx/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ inline void PrintFormatter::print(std::ostream& os, complex64_t val) {
os << val;
}

PrintFormatter& GetGlobalFormatter() {
PrintFormatter& get_global_formatter() {
static PrintFormatter formatter;
return formatter;
}
Expand Down Expand Up @@ -174,7 +174,7 @@ void print_subarray(std::ostream& os, const array& a, size_t index, int dim) {
i = n - num_print - 1;
index += s * (n - 2 * num_print - 1);
} else if (is_last) {
GetGlobalFormatter().print(os, a.data<T>()[index]);
get_global_formatter().print(os, a.data<T>()[index]);
} else {
print_subarray<T>(os, a, index, dim + 1);
}
Expand All @@ -190,7 +190,7 @@ void print_array(std::ostream& os, const array& a) {
os << "array(";
if (a.ndim() == 0) {
auto data = a.data<T>();
GetGlobalFormatter().print(os, data[0]);
get_global_formatter().print(os, data[0]);
} else {
print_subarray<T>(os, a, 0, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion mlx/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct PrintFormatter {
bool capitalize_bool{false};
};

PrintFormatter& GetGlobalFormatter();
PrintFormatter& get_global_formatter();

/** The type from promoting the arrays' types with one another. */
inline Dtype result_type(const array& a, const array& b) {
Expand Down
2 changes: 1 addition & 1 deletion python/src/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ArrayPythonIterator {

void init_array(nb::module_& m) {
// Set Python print formatting options
GetGlobalFormatter().capitalize_bool = true;
get_global_formatter().capitalize_bool = true;

// Types
nb::class_<Dtype>(
Expand Down

0 comments on commit f9d90c0

Please sign in to comment.