How do you randomly select a batchSize of fixed size during training?
Say I have my training input as a tensor of size [124, 3, 32, 32], during training, I want to randomly select a batch of 31 from the tensor e.g.
	for epoch in range(maxIter):
		images = Variable(train_X)  #e.g. train_X is a 124 tensor of images of size [3, 32, 32]
		labels = Variable(train_Y)    #e.g. train_Y is of size [124] of labels

		optimizer.zero_grad()
		outputs = convnet(images)  #convnet is a cnn

Is there a quick and easy function that allows batchSelection from the train_X and train_Y tensors images?