@testinfo()
def test_type_param_empty(self):
    shape_list = [(512, 1024, 2, 2, 4), (2, 3, 4), (254, 254, 112, 1, 1, 3), (1000,), ()]
    dtype_list = [torch.half, torch.float, torch.uint8, torch.int8, torch.short, torch.int, torch.long, torch.bool]
    for (shape, src_type) in product(shape_list, dtype_list):
        if (src_type in [torch.half, torch.float]):
            x = torch.randn(shape, dtype=src_type)
        elif (src_type == torch.uint8):
            x = torch.randint(0, 255, shape).to(src_type)
        else:
            x = torch.randint((- 128), 128, shape).to(src_type)
        out_cpu_type = x.type()
        out_mlu_type = x.to(ct.mlu_device()).type()
        l_tmp = out_cpu_type.split('.')
        l_tmp.insert(1, 'mlu')
        self.assertEqual('.'.join(l_tmp), out_mlu_type)
@testinfo()
def test_type_param_empty(self):
    shape_list = [(512, 1024, 2, 2, 4), (2, 3, 4), (254, 254, 112, 1, 1, 3), (1000,), ()]
    dtype_list = [torch.half, torch.float, torch.uint8, torch.int8, torch.short, torch.int, torch.long, torch.bool]
    for (shape, src_type) in product(shape_list, dtype_list):
        if (src_type in [torch.half, torch.float]):
            x = torch.randn(shape, dtype=src_type)
        elif (src_type == torch.uint8):
            x = torch.randint(0, 255, shape).to(src_type)
        else:
            x = torch.randint((- 128), 128, shape).to(src_type)
        out_cpu_type = x.type()
        out_mlu_type = x.to(ct.mlu_device()).type()
        l_tmp = out_cpu_type.split('.')
        l_tmp.insert(1, 'mlu')
        self.assertEqual('.'.join(l_tmp), out_mlu_type)