• Creates a tf.Tensor with integers sampled from a uniform distribution.

    The generated values are uniform integers in the range [minval, maxval). The lower bound minval is included in the range, while the upper bound maxval is excluded.

    tf.randomUniformInt([2, 2], 0, 10).print();
    

    Type Parameters

    • R extends Rank

    Parameters

    • shape: ShapeMap[R]

      An array of integers defining the output tensor shape.

    • minval: number

      Inclusive lower bound on the generated integers.

    • maxval: number

      Exclusive upper bound on the generated integers.

    • Optional seed: string | number

      An optional int. Defaults to 0. If seed is set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.

    Returns Tensor<R>

    Doc

Generated using TypeDoc