Thanks! I found tensor_split 1 but the problem is that my data have geometric ordering, for example, data stored at points surrounding a sphere. Constructing a fold manually would mean I’ve selected a sub-set of the sphere’s surface for testing, which won’t work. Random sampling would be better… if there aren’t libtorch native functions for that, I can use STL and hack something, but it would be nice to have something like a random_split(const at::tensor &, 0.1) giving std::vector<at::tensor> that splits the data randomly into 90% training, 10% validation sets.