Sha256: ff52dba953baa2b4b3573f2a3c793de5dec26918004bea54cfd326e52c0f709d

Contents?: true

Size: 698 Bytes

Versions: 9

Compression:

Stored size: 698 Bytes

Contents

TensorStream::OpMaker.define_operation :ones_like do |op|
  op.what_it_does "Creates a tensor with all elements set to 1."
  op.what_it_does "Given a single tensor (tensor), this operation returns a"
  op.what_it_does "tensor of the same type and shape as tensor with all elements set to 1."
  op.what_it_does "Optionally, you can specify a new type (dtype) for the returned tensor."


  op.parameter :input, "A tensor"
  op.option :dtype, "Optional new data type to cast into", :nil, alias: :data_type
  op.option :name, "Optional name", :nil

  op.define_shape do |tensor|
    tensor.inputs[0].shape.shape
  end

  op.define_gradient do |grad, node, params|
    nil # non differentiable
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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