Skip to content

fead: Add ggml_is_contiguous_{0,1,2} #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions ggml/ggml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,45 @@ def ggml_is_contiguous(tensor: ggml_tensor_p, /) -> bool:
...


# GGML_API GGML_CALL bool ggml_is_contiguous_0(const struct ggml_tensor * tensor);
@ggml_function("ggml_is_contiguous_0", [ctypes.POINTER(ggml_tensor)], ctypes.c_bool)
def ggml_is_contiguous_0(tensor: ggml_tensor_p, /) -> bool:
"""Check if a tensor is contiguous (same as ggml_is_contiguous)

Parameters:
tensor: tensor

Returns:
True if tensor is contiguous else False"""
...


# GGML_API GGML_CALL bool ggml_is_contiguous_1(const struct ggml_tensor * tensor);
@ggml_function("ggml_is_contiguous_1", [ctypes.POINTER(ggml_tensor)], ctypes.c_bool)
def ggml_is_contiguous_1(tensor: ggml_tensor_p, /) -> bool:
"""Check if a tensor is contiguous for dimensions >= 1

Parameters:
tensor: tensor

Returns:
True if tensor is contiguous for dims >= 1 else False"""
...


# GGML_API GGML_CALL bool ggml_is_contiguous_2(const struct ggml_tensor * tensor);
@ggml_function("ggml_is_contiguous_2", [ctypes.POINTER(ggml_tensor)], ctypes.c_bool)
def ggml_is_contiguous_2(tensor: ggml_tensor_p, /) -> bool:
"""Check if a tensor is contiguous for dimensions >= 2

Parameters:
tensor: tensor

Returns:
True if tensor is contiguous for dims >= 2 else False"""
...


# GGML_API GGML_CALL bool ggml_is_permuted (const struct ggml_tensor * tensor);
@ggml_function("ggml_is_permuted", [ctypes.POINTER(ggml_tensor)], ctypes.c_bool)
def ggml_is_permuted(tensor: ggml_tensor_p, /) -> bool:
Expand Down