Skip to content

Commit dc46980

Browse files
committed
feat: Update ggml
1 parent e739eea commit dc46980

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

ggml/ggml.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5574,6 +5574,7 @@ def ggml_pool_2d(
55745574

55755575

55765576
# // nearest interpolate
5577+
# // multiplies ne0 and ne1 by scale factor
55775578
# // used in stable-diffusion
55785579
# GGML_API struct ggml_tensor * ggml_upscale(
55795580
# struct ggml_context * ctx,
@@ -5593,6 +5594,8 @@ def ggml_upscale(
55935594
) -> ggml_tensor_p:
55945595
"""Upscale
55955596
5597+
Multiply ne0 and ne1 by scale factor
5598+
55965599
Parameters:
55975600
a: input tensor
55985601
scale_factor: scale factor
@@ -5602,6 +5605,51 @@ def ggml_upscale(
56025605
...
56035606

56045607

5608+
# // nearest interpolate
5609+
# // nearest interpolate to specified dimensions
5610+
# // used in tortoise.cpp
5611+
# GGML_API struct ggml_tensor * ggml_upscale_ext(
5612+
# struct ggml_context * ctx,
5613+
# struct ggml_tensor * a,
5614+
# int ne0,
5615+
# int ne1,
5616+
# int ne2,
5617+
# int ne3);
5618+
@ctypes_function(
5619+
"ggml_upscale_ext",
5620+
[
5621+
ggml_context_p_ctypes,
5622+
ctypes.POINTER(ggml_tensor),
5623+
ctypes.c_int,
5624+
ctypes.c_int,
5625+
ctypes.c_int,
5626+
ctypes.c_int,
5627+
],
5628+
ctypes.POINTER(ggml_tensor),
5629+
)
5630+
def ggml_upscale_ext(
5631+
ctx: ggml_context_p,
5632+
a: ggml_tensor_p,
5633+
ne0: Union[ctypes.c_int, int],
5634+
ne1: Union[ctypes.c_int, int],
5635+
ne2: Union[ctypes.c_int, int],
5636+
ne3: Union[ctypes.c_int, int],
5637+
/,
5638+
) -> ggml_tensor_p:
5639+
"""Upscale to specified dimensions
5640+
5641+
Parameters:
5642+
a: input tensor
5643+
ne0: dimension 0
5644+
ne1: dimension 1
5645+
ne2: dimension 2
5646+
ne3: dimension 3
5647+
5648+
Returns:
5649+
output tensor"""
5650+
...
5651+
5652+
56055653
# // pad each dimension with zeros: [x, ..., x] -> [x, ..., x, 0, ..., 0]
56065654
# GGML_API struct ggml_tensor * ggml_pad(
56075655
# struct ggml_context * ctx,

vendor/ggml

Submodule ggml updated from e87c055 to 126d349

0 commit comments

Comments
 (0)