Convert a numpy array of bf16 (uint16) to a numpy array of float
(arr)
| 123 | return np.right_shift(orig + bias, 16).astype("uint16") |
| 124 | |
| 125 | def np_bf162np_float(arr): |
| 126 | """Convert a numpy array of bf16 (uint16) to a numpy array |
| 127 | of float""" |
| 128 | u32 = np.left_shift(arr.astype("uint32"), 16) |
| 129 | return u32.view("<f4") |
| 130 | |
| 131 | def check_cuda(n, lanes): |
| 132 | vec_dtype = f"bfloat16x{lanes}" |
no test coverage detected
searching dependent graphs…