79734726

Date: 2025-08-13 20:47:13
Score: 0.5
Natty:
Report link

Cupy was outputting the floats as a cupy.array in the tuple comprehension above whereas numpy outputted the floats as floats. Changing the code to this produced the desired output:

import cupy as cp

def sortBis(mat: np.ndarray): 
    colInds = cp.lexsort(mat[:, 1:]) mat[:, 1:] = mat[:, 1:][:, colInds] 
    return mat

newMat = cp.array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.], [ 0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0., -1.]]

newMatSet.add(tuple(tuple(float(i) for i in row) for row in sortBis(newMat)))
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: EzTheBoss 2