mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
symbolic_simple does this cast folding now [pr] (#8422)
This commit is contained in:
parent
9defbc7d54
commit
22abd9dc03
1 changed files with 0 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue