]>
Commit | Line | Data |
---|---|---|
1d09f67e TL |
1 | // <auto-generated> |
2 | // automatically generated by the FlatBuffers compiler, do not modify | |
3 | // </auto-generated> | |
4 | ||
5 | namespace Apache.Arrow.Flatbuf | |
6 | { | |
7 | ||
8 | using global::System; | |
9 | using global::FlatBuffers; | |
10 | ||
11 | /// ---------------------------------------------------------------------- | |
12 | /// Data structures for dense tensors | |
13 | /// Shape data for a single axis in a tensor | |
14 | internal struct TensorDim : IFlatbufferObject | |
15 | { | |
16 | private Table __p; | |
17 | public ByteBuffer ByteBuffer { get { return __p.bb; } } | |
18 | public static TensorDim GetRootAsTensorDim(ByteBuffer _bb) { return GetRootAsTensorDim(_bb, new TensorDim()); } | |
19 | public static TensorDim GetRootAsTensorDim(ByteBuffer _bb, TensorDim obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } | |
20 | public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; } | |
21 | public TensorDim __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } | |
22 | ||
23 | /// Length of dimension | |
24 | public long Size { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } | |
25 | /// Name of the dimension, optional | |
26 | public string Name { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } | |
27 | #if ENABLE_SPAN_T | |
28 | public Span<byte> GetNameBytes() { return __p.__vector_as_span(6); } | |
29 | #else | |
30 | public ArraySegment<byte>? GetNameBytes() { return __p.__vector_as_arraysegment(6); } | |
31 | #endif | |
32 | public byte[] GetNameArray() { return __p.__vector_as_array<byte>(6); } | |
33 | ||
34 | public static Offset<TensorDim> CreateTensorDim(FlatBufferBuilder builder, | |
35 | long size = 0, | |
36 | StringOffset nameOffset = default(StringOffset)) { | |
37 | builder.StartObject(2); | |
38 | TensorDim.AddSize(builder, size); | |
39 | TensorDim.AddName(builder, nameOffset); | |
40 | return TensorDim.EndTensorDim(builder); | |
41 | } | |
42 | ||
43 | public static void StartTensorDim(FlatBufferBuilder builder) { builder.StartObject(2); } | |
44 | public static void AddSize(FlatBufferBuilder builder, long size) { builder.AddLong(0, size, 0); } | |
45 | public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(1, nameOffset.Value, 0); } | |
46 | public static Offset<TensorDim> EndTensorDim(FlatBufferBuilder builder) { | |
47 | int o = builder.EndObject(); | |
48 | return new Offset<TensorDim>(o); | |
49 | } | |
50 | }; | |
51 | ||
52 | ||
53 | } |