Solved by Valerio_Biscione in post #4 
              
              
                There are many ways of doing this

import numpy as np
import torch.nn as nn 
class ValueChoice():
    def __init__(self, values):
        self.values = values
        np.random.shuffle(self.values)

    def __iter__(self):
        for i in self.values:
            yield i

a = ValueChoice([1, 2, 3]…