@testinfo()
def test_type_param_empty_not_dense(self):
    shape_list = [(16, 32, 2, 30), (2, 3, 4, 32), (24, 26, 112, 64), (2, 3, 24, 30), (1, 1, 1, 30)]
    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)[:, :, :, :15]
        elif (src_type == torch.uint8):
            x = torch.randint(0, 255, shape).to(src_type)[:, :, :, :15]
        else:
            x = torch.randint((- 128), 128, shape).to(src_type)[:, :, :, :15]
        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_not_dense(self):
    shape_list = [(16, 32, 2, 30), (2, 3, 4, 32), (24, 26, 112, 64), (2, 3, 24, 30), (1, 1, 1, 30)]
    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)[:, :, :, :15]
        elif (src_type == torch.uint8):
            x = torch.randint(0, 255, shape).to(src_type)[:, :, :, :15]
        else:
            x = torch.randint((- 128), 128, shape).to(src_type)[:, :, :, :15]
        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)