Lesson 9 - Does the second generator override variables x and y?


Going through the notebook, I was wondering what is the purpose of two consecutive generators that assign the same variables (x and y):

trn_ds2 = ConcatLblDataset(md.trn_ds, trn_mcs) val_ds2 = ConcatLblDataset(md.val_ds, val_mcs) md.trn_dl.dataset = trn_ds2 md.val_dl.dataset = val_ds2

x,y=to_np(next(iter(md.val_dl))) x=md.val_ds.ds.denorm(x)

x,y=to_np(next(iter(md.trn_dl))) x=md.trn_ds.ds.denorm(x)

fig, axes = plt.subplots(3, 4, figsize=(16, 12)) for i,ax in enumerate(axes.flat): show_ground_truth(ax, x[i], y[0][i], y[1][i]) plt.tight_layout()

I guess the second assignment x, y overrides the previous, so I am not sure if the purpose of first assignment was just to demonstrate something or it has to be there in order to execute the rest of the code correctly.