numpy.packbits usage for numpy 1.14.0 support (#5078)

This commit is contained in:
Evgenya Stepyreva 2021-04-01 20:11:12 +03:00 committed by GitHub
parent 1a3e9abfbe
commit 8d2f58caad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ class Cast(Op):
bit_order_little = (padded[:, None] & (1 << np.arange(num_bits)) > 0).astype(np.uint8)
bit_order_big = np.flip(bit_order_little, axis=1)
bit_order_big_flattened = bit_order_big.flatten()
packed = np.packbits(bit_order_big_flattened, bitorder='big')
packed = np.packbits(bit_order_big_flattened)
node.out_node(0)['force_shape'] = data_shape.copy()
node.out_node(0)['force_type'] = np_data_type_to_precision(dst_type)