@ptrblck I changed the cond_dim dimension to [2048,1]:
cond_dim = cond_dim.repeat(2048,1)
actually just  as an input for decode in sample function because for other part for example
cvae = CVAE(c_dim=cond_dim1).to(device)
I couldn’t add 2D tensor. but The following error appeared after running:
---> 28     samples_model = cvae.sample()
     29     samples_gt = gen_batch(2048)
     30     kde_skl = KernelDensity(kernel='gaussian', bandwidth=0.2)

<ipython-input-120-59830598ea49> in sample(self, n)
     32       #  sample = cvae.decode(z, c)
     33         sample = torch.randn(n, K).to(device)
---> 34         out = cvae.decode(sample, cond_dim)
     35 
     36         return out.cpu().detach().numpy()

<ipython-input-120-59830598ea49> in decode(self, z, c)
     39     def decode(self, z, c):
     40         concat_input = torch.cat([z, c], 1)
---> 41         return self.fc5(F.selu(self.fc4(F.selu(self.fc3(concat_input)))))
     42 
     43     def forward(self, x, c):

~\anaconda3\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)
   1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1050                 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1051             return forward_call(*input, **kwargs)
   1052         # Do not call functions when jit is used
   1053         full_backward_hooks, non_full_backward_hooks = [], []

~\anaconda3\lib\site-packages\torch\nn\modules\linear.py in forward(self, input)
     94 
     95     def forward(self, input: Tensor) -> Tensor:
---> 96         return F.linear(input, self.weight, self.bias)
     97 
     98     def extra_repr(self) -> str:

~\anaconda3\lib\site-packages\torch\nn\functional.py in linear(input, weight, bias)
   1845     if has_torch_function_variadic(input, weight):
   1846         return handle_torch_function(linear, (input, weight), input, weight, bias=bias)
-> 1847     return torch._C._nn.linear(input, weight, bias)
   1848 
   1849 

RuntimeError: mat1 and mat2 shapes cannot be multiplied (2048x21 and 28x20)

I really stuck to this, could you please help me to go further. thanks in advance