From cdbe08b94b60b323919ae272c6111f9b17a29280 Mon Sep 17 00:00:00 2001 From: chenyu Date: Sun, 27 Oct 2024 11:42:31 -0400 Subject: [PATCH] use UOp.render in colored_shape (#7321) similar to function name, print rendered str instead of raw UOp --- tinygrad/codegen/kernel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tinygrad/codegen/kernel.py b/tinygrad/codegen/kernel.py index 57a01b8864..bcdf186b88 100644 --- a/tinygrad/codegen/kernel.py +++ b/tinygrad/codegen/kernel.py @@ -190,7 +190,8 @@ class Kernel: return colors def colored_shape(self, pad:Optional[int]=None, dense=False) -> str: - ret = ' '.join(colored(s, color) for s,color in zip([f"{s:4d}" if isinstance(s, int) and not dense else s for s in self.full_shape], self.colors())) # noqa: E501 + shape_strs = [(s if dense else f"{s:4d}") if isinstance(s, int) else s.render() for s in self.full_shape] + ret = ' '.join(colored(s, color) for s,color in zip(shape_strs, self.colors())) if pad: ret += ' '*(pad-ansilen(ret)) return ret