The randomtensor command generates a tensor of a random integers x with 0 <= x < z. If a fifth argument p is given, it is the probability that an integer is generated.
randomtensor(10,1,2,3); [[[2, 5, 9], [6, 4, 1]]]