title: I wanted to add lables and channels of an image seprately by myself?
body: <p><strong>for performing linear regression i did torch.stack and torch.cat to every other the torch.cat operation it took me about 10 min so i wanted to konw an optimal approach  .</strong></p>
  <pre><code>from torch.utils.data import random_split // used random_split to 
                                                           split data
  
  train_ds, val_ds = random_split(dataset,[50000,10000])
  len(train_ds) , len(val_ds)
  
  #linear regression self
  
  d = [ ]
  n = len(train_ds)
  for i in range(0,n):
      label = train_ds[i][1]
      d.append(label)
      
  
  a = train_ds[0][0]
  b = train_ds[1][0]    
  c = torch.stack((a,b))
  
  for i in range(2,n):
      l = train_ds[i][0].reshape(1,1,28,28)
      c = torch.cat((c,l))
      
          
  
  train_lables = torch.tensor(d)
  
  </code></pre>
  <p><strong>it took (10-15 mins)</strong></p>