Unary ops implemented #9437 , #9436
These ops were directly implemented using their respective operators ( ~ , & , | ) . But the same method cannot be used in binary as these operators are not available outside the kernel.
Binary Shift operators
Op Requirement :
ElemwiseBinary/ELEMWISE_BINARY_LEFT_SHIFT
ElemwiseBinary/ELEMWISE_BINARY_RIGHT_SHIFT
Issues :
Initial Implementation done in #8636
This implementation requires the involvement of a lot of ops, which may lead to performance issues.
LCM, GCD
Op Requirement :
ElemwiseBinary/ELEMWISE_BINARY_LCM
ElemwiseBinary/ELEMWISE_BINARY_GCD
Issues :
Implementing one of these ops, can make it easier for the other implementation as their are dependant .We have come up two approaches for GCD
Using for loop
def custom_gcd(a, b):
def gcd(x, y):
min_val = x if x < y else y
for i in range(min_val, 0, -1):
if x % i == 0 and y % i == 0:
return i
return 1
return np.array([gcd(int(x), int(y)) for x, y in zip(a, b)])
Recursive method
def custom_gcd(a, b):
def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
return np.array([gcd(x, y) for x, y in zip(a, b)])
Nested for loops
But these methods would involve repetitive loops/calling of a function.
Blocker issues discussed :
Binary Bitwise ops
Op Requirement :
Issues :
Unary ops implemented #9437 , #9436 These ops were directly implemented using their respective operators ( ~ , & , | ) . But the same method cannot be used in binary as these operators are not available outside the kernel.
Binary Shift operators
Op Requirement :
Issues :
Initial Implementation done in #8636 This implementation requires the involvement of a lot of ops, which may lead to performance issues.
LCM, GCD
Op Requirement :
Issues :
Implementing one of these ops, can make it easier for the other implementation as their are dependant .We have come up two approaches for GCD
Using for loop
Recursive method
But these methods would involve repetitive loops/calling of a function.