Try to wrap it in a tuple or list as:
all_classes=torch.stack((head_features_var[0], head_features_var[1], head_features_var[2], head_features_var[3], head_features_var[4], head_features_var[5], head_features_var[6], tail_features_mean_var[7],tail_features_mean_var[8],tail_features_mean_var[9]))