code: def execute(cls, ctx, op):
      xp = array_module(op.gpu)
      if xp is np:
          device_id = -1
      else:
          device_id = op.device or 0
      get_val = (
          lambda x: ctx[x.key]
          if isinstance(x, TENSOR_CHUNK_TYPE)
          else x
      )
  
      with device(device_id):
          rs = xp.random.RandomState(op.seed)
  
          method_name = getattr(cls, "_func_name")
          try:
              if method_name in ("rand", "randn"):
                  try:
                      res = getattr(rs, method_name)(
                          *op.size, dtype=op.dtype
                      )
                  except TypeError:
                      res = getattr(rs, method_name)(*op.size)
              elif method_name == "randint":
                  try:
                      res = rs.randint(
                          get_val(op.low),
                          get_val(op.high),
                          size=op.size,
                          dtype=op.dtype,
                      )
                  except TypeError:
                      res = rs.randint(
                          get_val(op.low),
                          get_val(op.high),
                          size=op.size,
                      )
              else:
                  try:
                      res = getattr(rs, method_name)(
                          *(
                              get_val(getattr(op, arg))
                              for arg in op.args
                          ),
                          dtype=op.dtype,
                      )
                  except TypeError:
                      res = getattr(rs, method_name)(
                          *(
                              get_val(getattr(op, arg))
                              for arg in op.args
                          )
                      )
              if hasattr(res, "dtype") and res.dtype != op.dtype:
                  res = res.astype(op.dtype, copy=False)
              if xp is not np:
                  ctx[op.outputs[0].key] = xp.asarray(res)
              else:
                  ctx[op.outputs[0].key] = res
          except AttributeError:
              if xp is not np:
                  # cupy cannot generate data, fallback to numpy
                  rs = np.random.RandomState(op.seed)
                  if method_name in ("rand", "randn"):
                      res = getattr(rs, method_name)(*op.size)
                  else:
                      res = getattr(rs, method_name)(
                          *(
                              get_val(getattr(op, arg))
                              for arg in op.args
                          )
                      )
                  if res.dtype != op.dtype:
                      res = res.astype(op.dtype, copy=False)
                  ctx[op.outputs[0].key] = xp.asarray(res)
              else:
                  raise
  
imports: import itertools
  from collections.abc import Iterable
  from contextlib import contextmanager
  import numpy
  from ...config import options
  from ...core import recursive_tile
  from ...serialization.serializables import FieldTypes, TupleField, Int32Field
  from ..core import TENSOR_TYPE, TENSOR_CHUNK_TYPE
  from ..utils import decide_chunk_sizes, gen_random_seeds, broadcast_shape
  from ..array_utils import array_module, device
  from ..operands import TensorOperand, TensorMapReduceOperand, TensorOperandMixin
  from ..datasource import tensor
  from ..base import broadcast_to
label_desc: Use image node_id 2 for calling the TensorRandomOperandMixin obj's underlying member method code with example usage: obj.execute(cls, ctx, op) without return types