mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Use SmallVector for shapes and strides
This commit is contained in:
17
python/src/small_vector.h
Normal file
17
python/src/small_vector.h
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright © 2025 Apple Inc.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "mlx/small_vector.h"
|
||||
|
||||
#include <nanobind/stl/detail/nb_list.h>
|
||||
|
||||
NAMESPACE_BEGIN(NB_NAMESPACE)
|
||||
NAMESPACE_BEGIN(detail)
|
||||
|
||||
template <typename Type, size_t Size, typename Alloc>
|
||||
struct type_caster<mlx::core::SmallVector<Type, Size, Alloc>>
|
||||
: list_caster<mlx::core::SmallVector<Type, Size, Alloc>, Type> {};
|
||||
|
||||
NAMESPACE_END(detail)
|
||||
NAMESPACE_END(NB_NAMESPACE)
|
||||
Reference in New Issue
Block a user