Class: ArrowFormat::Org::Apache::Arrow::Flatbuf::TensorDim

Inherits:
FlatBuffers::Table
  • Object
show all
Defined in:
lib/arrow-format/org/apache/arrow/flatbuf/tensor_dim.rb

Overview


Data structures for dense tensors Shape data for a single axis in a tensor

Constant Summary collapse

FIELDS =
{
  size: ::FlatBuffers::Field.new(:size, 0, 4, :long, 0),
  name: ::FlatBuffers::Field.new(:name, 1, 6, :string, 0),
}
Data =
define_data_class

Instance Method Summary collapse

Instance Method Details

#nameObject

Name of the dimension, optional



26
27
28
29
30
31
# File 'lib/arrow-format/org/apache/arrow/flatbuf/tensor_dim.rb', line 26

def name
  field_offset = @view.unpack_virtual_offset(6)
  return nil if field_offset.zero?

  @view.unpack_string(field_offset)
end

#sizeObject

Length of dimension



34
35
36
37
38
39
# File 'lib/arrow-format/org/apache/arrow/flatbuf/tensor_dim.rb', line 34

def size
  field_offset = @view.unpack_virtual_offset(4)
  return 0 if field_offset.zero?

  @view.unpack_long(field_offset)
end