mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-24 22:38:16 -05:00
symbolic_simple does this cast folding now [pr] (#8422)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user