From 987862ad8c218cdb459ca03d5c60727c4a20cc26 Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Thu, 6 Nov 2025 21:51:20 -0500 Subject: [PATCH] gguf-py : __pos__ is also unary --- gguf-py/gguf/lazy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gguf-py/gguf/lazy.py b/gguf-py/gguf/lazy.py index 6d0f1cbbbd..c126f09c50 100644 --- a/gguf-py/gguf/lazy.py +++ b/gguf-py/gguf/lazy.py @@ -50,7 +50,7 @@ class LazyMeta(ABCMeta): for binary_op in ( "lt", "le", "eq", "ne", "ge", "gt", "add", "and", "floordiv", "lshift", "mod", "mul", "matmul", - "or", "pos", "pow", "rshift", "sub", "truediv", "xor", + "or", "pow", "rshift", "sub", "truediv", "xor", "iadd", "iand", "ifloordiv", "ilshift", "imod", "imul", "ior", "irshift", "isub", "ixor", "radd", "rand", "rfloordiv", "rmul", "ror", "rpow", "rsub", "rtruediv", "rxor", ): @@ -58,7 +58,7 @@ class LazyMeta(ABCMeta): # evaluation on the meta tensor is needed in case there's broadcasting namespace[attr_name] = mk_wrap(attr_name, meta_noop=False) - for unary_op in ("not", "abs", "invert", "neg"): + for unary_op in ("not", "abs", "invert", "neg", "pos"): attr_name = f"__{unary_op}__" # the result of these operators usually has the same shape and dtype as the input, # so evaluation on the meta tensor can be skipped.