Thank you for your advice. The number of the patches is fixed, but it’s too large, so if a create these before train, I have to wait a very long time. But I think the second idea can be useful in my code, thank you!