I’m trying to implement DCGAN on MNIST

  
      github.com
  
  
    maxmatical/pytorch-projects/blob/master/generative models/DCGAN-MNIST.ipynb 255
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.4.1\n"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "print(torch.__version__)"
   ]
  },


  This file has been truncated. show original

  
  
    
    
  
  


When I start training the model, I’m getting the following warning:
/Users/maxtian/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py:1594: UserWarning: Using a target size (torch.Size([128])) that is different to the input size (torch.Size([128, 1, 1, 1])) is deprecated. Please ensure they have the same size.
  "Please ensure they have the same size.".format(target.size(), input.size()))

How can I fix this, I’m thinking it might be due to the torch.ones/torch.zeros