Sha256: b815bab293390776017a76ecb859da25a96db1d68f9c51693ad3a462690dbd13

Contents?: true

Size: 1010 Bytes

Versions: 9

Compression:

Stored size: 1010 Bytes

Contents

TensorStream::OpMaker.define_operation :random_uniform do |op|
  op.what_it_does "Outputs random values from a uniform distribution."

  op.parameter :shape, "A 1-D integer Tensor or array. The shape of the output tensor."

  op.option :name, "Optional name", :nil
  op.option :dtype, "The type of the output: float16, float32, float64, int32, or int64", ":float32"
  op.option :minval, "A 0-D Tensor or ruby value of type dtype. The lower bound on the range of random values to generate. Defaults to 0.", 0
  op.option :maxval, "A 0-D Tensor or ruby value of type dtype. The upper bound on the range of random values to generate. Defaults to 1 if dtype is floating point.", 1
  op.option :seed, " A ruby integer. Used to create a random seed for the distribution. See set_random_seed for behavior.", :nil

  op.define_shape do |tensor|
    a_shape = tensor.inputs[0] ? tensor.inputs[0].const_value : tensor.options[:shape]
    next nil if a_shape.nil?

    a_shape.is_a?(Array) ? a_shape : [a_shape]
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tensor_stream-1.0.9 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.8 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.7 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.6 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.5 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.4 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.3 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.2 lib/tensor_stream/ops/random_uniform.rb
tensor_stream-1.0.1 lib/tensor_stream/ops/random_uniform.rb