Sha256: 6df6a9a4cfe98d80bab625b74530a360c84235a8ec1c7924eab1a7ca0de3fd82

Contents?: true

Size: 762 Bytes

Versions: 9

Compression:

Stored size: 762 Bytes

Contents

TensorStream::OpMaker.define_operation :expand_dims do |op|
  op.what_it_does "Inserts a dimension of 1 into a tensor's shape. "
  op.what_it_does "Given a tensor input, this operation inserts a dimension of 1 at the dimension index axis of input's shape. The "
  op.what_it_does "dimension index axis starts at zero; if you specify a negative number for axis it is counted backward from the end."

  op.parameter :input, "A tensor"
  op.parameter :axis, "Specifies the dimension index at which to expand the shape of input. Must be in the range [-rank(input) - 1, rank(input)]."
  op.option :name, "Optional name", :nil

  op.define_gradient do |grad, node, params|
    [_reshape_to_input(node, grad), nil]
  end

  op.define_shape do |tensor|
    nil
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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