I tried to implement 3 Bayesian NN simultaneously each outputs a tuple, however when I combined their results using torch cat I got the same error: ValueError: only one element tensors can be converted to Python scalars.
my code is as following:
self.bcnn1=nn.Sequential(bcnn1d(in_channels=self.in_channels, out_channels=8,
kernel_size=5, padding=2, dilation=1),
BN(num_features=8))
self.bcnn2=nn.Sequential(bcnn1d(in_channels=self.in_channels, out_channels=8,
kernel_size=5, padding=6, dilation=3),
BN(num_features=8))
self.bcnn3=nn.Sequential(bcnn1d(in_channels=self.in_channels, out_channels=8,
kernel_size=5,padding=12, dilation=6),
BN(num_features=8))
bcnn_out = self.bcnn(torch.cat(bcnn1, bcnn2, bcnn3),dim=1)
however, I tried co convert each one onf the bcnn to a tensor but got ValueError: only one element tensors can be converted to Python scalars
:
bcnn_out = self.bcnn(torch.cat(torch.Tensor(bcnn_out1), torch.Tensor(bcnn_out2), torch.Tensor(bcnn_out3))