def test_const_type(self, compute_unit, backend, dtype):
        """Makes sure the ndarray in const has the correct type."""
        @mb.program(input_specs=[], opset_version=backend.opset_version)
        def prog():
            return mb.const(val=np.random.randint(0, 5, (4, 2)).astype(dtype))

        const_op = prog.functions["main"].find_ops(op_type="const")[0]

        if dtype == np.int64:
            target_dtype = np.int32
        elif dtype == np.float64:
            target_dtype = np.float32
        else:
            target_dtype = dtype
        assert const_op.outputs[0].dtype == types.numpy_type_to_builtin_type(target_dtype)
Makes sure the ndarray in const has the correct type.
coremltools/converters/mil/mil/ops/tests/iOS14/test_control_flow.py