def test_tensorwise_equivalent_to_blockwise_zero(self, nbits, mode):
        """The block_size=0 in palettization is equivalent to legacy tensorwise compression."""
        original_data = np.random.randint(low=-256, high=256, size=(16, 16, 2, 2)).astype(
            np.float32
        )
        params_old = quantization.palettize_weights.compress(original_data, mode, nbits)
        decompressed_old = quantization.palettize_weights.decompress(params_old)
        params_new = quantization.palettize_weights.blockwise_compress(
            original_data, mode, nbits, block_sizes=[0] * len(original_data.shape)
        )
        decompressed_new = quantization.palettize_weights.decompress(params_new)
        np.testing.assert_allclose(
            np.sort(params_old.lut, axis=None),
            np.sort(params_new.lut, axis=None),
            atol=5e-5,
            rtol=1e-6,
        )
        np.testing.assert_allclose(decompressed_old, decompressed_new, atol=5e-5, rtol=1e-6)
The block_size=0 in palettization is equivalent to legacy tensorwise compression.
coremltools/test/optimize/coreml/test_passes.py