Sha256: b85f10a947a3b230e3cf7214ca8b0e248f4f60367d62fa293f6707153a5cfaa6

Contents?: true

Size: 509 Bytes

Versions: 9

Compression:

Stored size: 509 Bytes

Contents

TensorStream::OpMaker.define_operation :zeros do |op|
  op.what_it_does "Creates a tensor with all elements set to zero"

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

  op.option :dtype, "Optional name", ":float32"
  op.option :name, "Optional name", :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/zeros.rb
tensor_stream-1.0.8 lib/tensor_stream/ops/zeros.rb
tensor_stream-1.0.7 lib/tensor_stream/ops/zeros.rb
tensor_stream-1.0.6 lib/tensor_stream/ops/zeros.rb
tensor_stream-1.0.5 lib/tensor_stream/ops/zeros.rb
tensor_stream-1.0.4 lib/tensor_stream/ops/zeros.rb
tensor_stream-1.0.3 lib/tensor_stream/ops/zeros.rb
tensor_stream-1.0.2 lib/tensor_stream/ops/zeros.rb
tensor_stream-1.0.1 lib/tensor_stream/ops/zeros.rb