You should keep the data in float instead of casting it to long.
Also, your current model won’t work, as your linear layer outputs [batch_size, 128 * 6 * 6] and you are trying to use nn.UpsamlingBilinear2d on it, which expects the input to have the shape [batch_size, channels, h, w].
Here is a small working example:
batch_size = 1

class View(nn.Module):
    def __init__(self, size):
        super(View, self).__init__()
        self.size = size
    
    def forward(self, x):
        x = x.view(self.size)
        return x

G = nn.Sequential(
    nn.Linear(100, 128 * 6 * 6),
    nn.ReLU(),
    View((batch_size, 128, 6, 6)),
    nn.Upsample(size=12),
    nn.Conv2d(in_channels=128, out_channels=128, kernel_size=4),
    nn.ReLU(),
    nn.Upsample(24),
    nn.Conv2d(in_channels=128, out_channels=64, kernel_size=4),
    nn.ReLU(),
    nn.Conv2d(in_channels=64, out_channels=3, kernel_size=4),
    nn.Tanh()
)


x = torch.randn(batch_size, 100)
output = G(x)