MLX
Loading...
Searching...
No Matches
Namespaces | Functions
utils.h File Reference
#include <vector>
#include "mlx/array.h"

Go to the source code of this file.

Namespaces

namespace  mlx
 
namespace  mlx::core
 

Functions

template<typename stride_t >
stride_t mlx::core::elem_to_loc (int elem, const std::vector< int > &shape, const std::vector< stride_t > &strides)
 
size_t mlx::core::elem_to_loc (int elem, const array &a)
 
template<typename stride_t >
std::vector< stride_t > mlx::core::make_contiguous_strides (const std::vector< int > &shape)
 
template<typename stride_t >
std::tuple< std::vector< int >, std::vector< std::vector< stride_t > > > mlx::core::collapse_contiguous_dims (const std::vector< int > &shape, const std::vector< std::vector< stride_t > > strides)
 
std::tuple< std::vector< int >, std::vector< std::vector< size_t > > > mlx::core::collapse_contiguous_dims (const std::vector< array > &xs)
 
template<typename... Arrays, typename = enable_for_arrays_t<Arrays...>>
auto mlx::core::collapse_contiguous_dims (Arrays &&... xs)
 
std::tuple< std::vector< int >, std::vector< size_t > > mlx::core::collapse_contiguous_dims (const std::vector< int > &shape, const std::vector< size_t > &strides)
 
template<typename stride_t >
auto mlx::core::check_contiguity (const std::vector< int > &shape, const std::vector< stride_t > &strides)
 
bool mlx::core::is_donatable (const array &in, const array &out)