Sha256: 0f0197cd42f34b88a44f9337e884dc5b7c5ff5433654deddbe02be35510c60c1

Contents?: true

Size: 348 Bytes

Versions: 9

Compression:

Stored size: 348 Bytes

Contents

TensorStream::OpMaker.define_operation :rank do |op|
  op.what_it_does "Returns the rank of a tensor"

  op.parameter :input, "A tensor"
  op.option :name, "Optional name", :nil

  op.add_custom "input = convert_to_tensor(input)"
  op.add_custom "return cons(input.shape.ndims) if input.shape.known?"

  op.define_shape do |tensor|
    []
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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