From 22abd9dc03d64a7fefaebd7b01a92e498f76c8af Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:16:21 +0200 Subject: [PATCH] symbolic_simple does this cast folding now [pr] (#8422) --- tinygrad/ops.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tinygrad/ops.py b/tinygrad/ops.py index b08d54efd5..0f7a0c0d5e 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -345,7 +345,6 @@ class UOp(MathTrait, metaclass=UOpMetaClass): if count == 1: return self return UOp(Ops.VECTORIZE, self.dtype.vec(count), (self,)*count) def cast(self, dtype:DType, bitcast=False, allow_buffer_view=True): - if self.dtype == dtype: return self # TODO: move this to the scheduler if bitcast: return self.bitcast(dtype, allow_buffer_view) if self._device is not None and self._device.startswith("DISK"): raise RuntimeError("CAST isn't supported on DISK") if getenv("CAST_BEFORE_VIEW", 1) and dtype.itemsize <= self.dtype.itemsize and self is not self.base: