tvm_tirx.testing.generate_random_array

tvm_tirx.testing.generate_random_array#

tvm_tirx.testing.generate_random_array(dtype, shape)#

Generate a random array by generating random bits and casting to the target dtype.

Supported dtypes:
  • “int8”, “uint8”, “float16”, “float32”, “bfloat16”, “float8_e4m3fn”, “float8_e5m2”

Parameters:
  • dtype (str)

  • shape (tuple)

Return type:

ndarray