              X = nd.array(X.asnumpy()[idx])
              y = nd.array(y.asnumpy()[idx])
  
          for i in range(n//self.batch_size):
              yield (X[i*self.batch_size:(i+1)*self.batch_size],
                     y[i*self.batch_size:(i+1)*self.batch_size])
  
      def __len__(self):
          return len(self.dataset)//self.batch_size
  
  def load_data_fashion_mnist(batch_size, resize=None, root="~/.mxnet/datasets/fashion-mnist"):
 
</s> remove     def __init__(self, dataset, batch_size, shuffle):
 </s> add     def __init__(self, dataset, batch_size, shuffle, transform): </s> remove     mnist_train = gluon.data.vision.FashionMNIST(root=root, train=True, transform=transform_mnist)
    mnist_test = gluon.data.vision.FashionMNIST(root=root, train=False, transform=transform_mnist)
    train_data = DataLoader(mnist_train, batch_size, shuffle=True)
    test_data = DataLoader(mnist_test, batch_size, shuffle=False)
 </s> add     
    mnist_train = gluon.data.vision.FashionMNIST(root=root, train=True, transform=None)
    mnist_test = gluon.data.vision.FashionMNIST(root=root, train=False, transform=None)
    train_data = DataLoader(mnist_train, batch_size, shuffle=True, transform = transform_mnist)
    test_data = DataLoader(mnist_test, batch_size, shuffle=False, transform = transform_mnist)
            if self.transform is not None:
                yield self.transform(X[i*self.batch_size:(i+1)*self.batch_size], 
                                     y[i*self.batch_size:(i+1)*self.batch_size])
            else:
                yield (X[i*self.batch_size:(i+1)*self.batch_size],
                       y[i*self.batch_size:(i+1)*self.batch_size])
              X = nd.array(X.asnumpy()[idx])
              y = nd.array(y.asnumpy()[idx])
  
          for i in range(n//self.batch_size):
            if self.transform is not None:
                yield self.transform(X[i*self.batch_size:(i+1)*self.batch_size], 
                                     y[i*self.batch_size:(i+1)*self.batch_size])
            else:
                yield (X[i*self.batch_size:(i+1)*self.batch_size],
                       y[i*self.batch_size:(i+1)*self.batch_size])
            if self.transform is not None:
                yield self.transform(X[i*self.batch_size:(i+1)*self.batch_size], 
                                     y[i*self.batch_size:(i+1)*self.batch_size])
            else:
                yield (X[i*self.batch_size:(i+1)*self.batch_size],
                       y[i*self.batch_size:(i+1)*self.batch_size])
  
      def __len__(self):
          return len(self.dataset)//self.batch_size
  
  def load_data_fashion_mnist(batch_size, resize=None, root="~/.mxnet/datasets/fashion-mnist"):
keep keep keep keep replace replace keep keep keep keep keep
 fix for resize to 224 when training AlextNet in alexnet-gluon.md 
utils.py