As I understand it, you have a list of lists, with each list containing a numpy 48x48 array and an integer label. You want to parse this into two tensors, a 4x48x48 tensor, and a (4,) tensor.
Couldn’t you unzip the list and then send the two resulting lists into the tensor constructor? as so:
import numpy as np
import torch

data =[
  [np.random.rand(48, 48), 1],
  [np.random.rand(48, 48), 0],
  [np.random.rand(48, 48), 1],
  [np.random.rand(48, 48), 0]]

imgs, labels = zip(*data)  # unzip operation
x = torch.Tensor(imgs)
y = torch.LongTensor(labels)