randint function

VARP randint(
  1. int low, {
  2. int? high,
  3. List<int> size = const [],
  4. int seed0 = 0,
  5. int seed1 = 0,
})

Implementation

VARP randint(
  int low, {
  int? high,
  List<int> size = const [],
  int seed0 = 0,
  int seed1 = 0,
}) {
  final low_ = high == null ? 0 : low;
  high ??= low;
  return F.cast<int32>(
    F.randomUniform<float32>(
      F.constant<int32>(size, [size.length], format: DimensionFormat.NCHW),
      low: low_.toDouble(),
      high: high.toDouble(),
      seed0: seed0,
      seed1: seed1,
    ),
  );
}