mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 15:38:29 -05:00
add rlshift and rrshift special methods (#7185)
This commit is contained in:
@@ -55,7 +55,9 @@ class MathTrait:
|
||||
def __mul__(self, x): return self.alu(BinaryOps.MUL, self.ufix(x))
|
||||
def __rmul__(self, x): return self.ufix(x).alu(BinaryOps.MUL, self)
|
||||
def __lshift__(self, x): return self.alu(BinaryOps.SHL, self.ufix(x))
|
||||
def __rlshift__(self, x): return self.ufix(x).alu(BinaryOps.SHL, self)
|
||||
def __rshift__(self, x): return self.alu(BinaryOps.SHR, self.ufix(x))
|
||||
def __rrshift__(self, x): return self.ufix(x).alu(BinaryOps.SHR, self)
|
||||
def __floordiv__(self, x): return self.alu(BinaryOps.IDIV, self.ufix(x))
|
||||
def __rfloordiv__(self, x): return self.ufix(x).alu(BinaryOps.IDIV, self)
|
||||
def __truediv__(self, x): return self.alu(BinaryOps.MUL, self.ufix(x).alu(UnaryOps.RECIP))
|
||||
|
||||
Reference in New Issue
Block a user