In the DCGAN code, data contains the input and target tensor as a tuple.
Thus the code uses indexing to get the input sample using data[0].
If your DataLoader and Dataset only returns the input sample without a target, you don’t need this indexing.