How to create a random tensor with a given shape in pytorch lite (Java)?

I want to create a random tensor with a shape (BxHxWxC) to test my ptl model. How can I create it?

I have seen the documentation here: Tensor (pytorch_host 1.4.0 API)

I see fromBlob but not any method to create a random tensor with a specific shape which is pretty normal in pytorch to test a model.

Java API is mainly for model inference and doesn’t support such tensor operations. You may create a random array in Java and use fromBlob to construct the random tensor.