Bounding Box around an object

I am given the ground truth about the bounding box around a particular object in an image.
I am using a convolutional neural network to predict the bounding boxes as a 1 x 4 tensor.
But the problem is that in the given dataset, the ground truth bounding box values are given as a list. So
i am getting this error for the BB as shown below

inputs, labelsv, BBv = Variable(inputs), Variable(labels),Variable(BB)
RuntimeError: Variable data has to be a tensor, but got list

Please help how to rectify it and calculate the loss

Variable(torch.Tensor(BB)). You can replace torch.Tensor with the type of desired precision, e.g. torch.DoubleTensor, torch.HalfTensor. If you run on GPU , remember to add .cuda() to either the Tensor or the Variable.

So my code is as follows :

inputs, labels,BB = data[‘image’],data[‘label’],data[‘BB’]
BB = torch.Tensor(BB)

And the output prints:
[torch.LongTensor of size 4]
<class ‘list’>
BB = torch.Tensor(BB)
TypeError: ‘torch.LongTensor’ object does not support indexing

Please explain.

Oh I see. From the output (which seems to be missing the first half), BB is a list of a single tensor. Then just use Variable(BB[0])