Contents

randomUniformTensor(withShapeTensor:seed:name:)

Creates a RandomUniform operation and returns random uniform values

Declaration

func randomUniformTensor(withShapeTensor shapeTensor: MPSGraphTensor, seed: Int, name: String?) -> MPSGraphTensor

Parameters

  • shapeTensor:

    1D Int32 or Int64 tensor. The shape of the tensor generated

  • seed:

    The seed to use to initialize state. All calls with equal seed yield an identical stream of random values.

  • name:

    The name for the operation.

Return Value

An MPSGraphTensor of shape containing random values in the defined range.

Discussion

Returns a tensor of provided shape of random uniform values in the range [0.0, 1.0). Uses the provided seed value to initalize state. No state is preserved, and all calls with equal seed yield an identical stream of random values.