Handle Keyword dict keys in fused-pipeline primitive
Some checks are pending
GPU Worker CI/CD / test (push) Waiting to run
GPU Worker CI/CD / deploy (push) Blocked by required conditions

This commit is contained in:
giles
2026-02-04 09:53:28 +00:00
parent b773689814
commit 1442216a15
2 changed files with 22 additions and 5 deletions

View File

@@ -858,6 +858,19 @@ except ImportError as e:
_FUSED_PIPELINE_CACHE = {}
def _normalize_effect_dict(effect):
"""Convert effect dict with Keyword keys to string keys."""
result = {}
for k, v in effect.items():
# Handle Keyword objects from sexp parser
if hasattr(k, 'name'): # Keyword object
key = k.name
else:
key = str(k)
result[key] = v
return result
def prim_fused_pipeline(img, effects_list, **dynamic_params):
"""
Apply a fused CUDA kernel pipeline to an image.
@@ -879,6 +892,9 @@ def prim_fused_pipeline(img, effects_list, **dynamic_params):
Supported ops: rotate, zoom, ripple, invert, hue_shift, brightness
"""
# Normalize effects list - convert Keyword keys to strings
effects_list = [_normalize_effect_dict(e) for e in effects_list]
if not _FUSED_KERNELS_AVAILABLE:
# Fallback: apply effects one by one
result = img