Fix empty reduce inputs, bincount
parent
cecaecb9e6
commit
41498c9b69
File diff suppressed because it is too large
Load Diff
|
@ -496,6 +496,15 @@ public class JavaSourceArgDescriptorSource implements ArgDescriptorSource {
|
|||
.setArgIndex(boolIdx)
|
||||
.build()).build());
|
||||
|
||||
argDescriptorProposals.add(ArgDescriptorProposal.builder()
|
||||
.sourceOfProposal("java")
|
||||
.proposalWeight(9999.0)
|
||||
.descriptor(OpNamespace.ArgDescriptor.newBuilder()
|
||||
.setArgType(OpNamespace.ArgDescriptor.ArgType.INPUT_TENSOR)
|
||||
.setName("dimensions")
|
||||
.setIsArray(false)
|
||||
.setArgIndex(1)
|
||||
.build()).build());
|
||||
}
|
||||
|
||||
|
||||
|
@ -542,6 +551,20 @@ public class JavaSourceArgDescriptorSource implements ArgDescriptorSource {
|
|||
}
|
||||
}
|
||||
|
||||
if(name.contains("loop_cond")) {
|
||||
argDescriptorProposals.add(ArgDescriptorProposal.builder()
|
||||
.sourceOfProposal("java")
|
||||
.proposalWeight(9999.0)
|
||||
.descriptor(OpNamespace.ArgDescriptor.newBuilder()
|
||||
.setArgType(OpNamespace.ArgDescriptor.ArgType.INPUT_TENSOR)
|
||||
.setName("input")
|
||||
.setIsArray(false)
|
||||
.setArgIndex(0)
|
||||
.build()).build());
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(name.equals("top_k")) {
|
||||
if(!containsProposalWithDescriptorName("sorted",argDescriptorProposals)) {
|
||||
argDescriptorProposals.add(ArgDescriptorProposal.builder()
|
||||
|
|
|
@ -64,7 +64,7 @@ public class Libnd4jArgDescriptorSource implements ArgDescriptorSource {
|
|||
public final static String T_ARG = "T_ARG";
|
||||
public final static String B_ARG = "B_ARG";
|
||||
public final static String DECLARE_SYN = "DECLARE_SYN";
|
||||
public final static String DEFAULT_LIBND4J_DIRECTORY = "../../libnd4j";
|
||||
public final static String DEFAULT_LIBND4J_DIRECTORY = "../../../libnd4j";
|
||||
public final static int BROADCASTABLE_OP_IMPL_DEFAULT_NIN = 2;
|
||||
public final static int BROADCASTABLE_OP_IMPL_DEFAULT_NOUT = 1;
|
||||
public final static String CUSTOM_OP_IMPL = "CUSTOM_OP_IMPL";
|
||||
|
|
|
@ -1,22 +1,19 @@
|
|||
/*
|
||||
* ******************************************************************************
|
||||
* *
|
||||
* *
|
||||
* * This program and the accompanying materials are made available under the
|
||||
* * terms of the Apache License, Version 2.0 which is available at
|
||||
* * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
* *
|
||||
* * See the NOTICE file distributed with this work for additional
|
||||
* * information regarding copyright ownership.
|
||||
* * Unless required by applicable law or agreed to in writing, software
|
||||
* * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* * License for the specific language governing permissions and limitations
|
||||
* * under the License.
|
||||
* *
|
||||
* * SPDX-License-Identifier: Apache-2.0
|
||||
* *****************************************************************************
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2015-2018 Skymind, Inc.
|
||||
* Copyright (c) 2019-2020 Konduit K.K.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License, Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
******************************************************************************/
|
||||
|
||||
//
|
||||
// @author raver119@gmail.com
|
||||
|
|
|
@ -1,22 +1,19 @@
|
|||
/*
|
||||
* ******************************************************************************
|
||||
* *
|
||||
* *
|
||||
* * This program and the accompanying materials are made available under the
|
||||
* * terms of the Apache License, Version 2.0 which is available at
|
||||
* * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
* *
|
||||
* * See the NOTICE file distributed with this work for additional
|
||||
* * information regarding copyright ownership.
|
||||
* * Unless required by applicable law or agreed to in writing, software
|
||||
* * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* * License for the specific language governing permissions and limitations
|
||||
* * under the License.
|
||||
* *
|
||||
* * SPDX-License-Identifier: Apache-2.0
|
||||
* *****************************************************************************
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2015-2018 Skymind, Inc.
|
||||
* Copyright (c) 2019-2020 Konduit K.K.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License, Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
******************************************************************************/
|
||||
|
||||
//
|
||||
// @author raver119@gmail.com
|
||||
|
|
|
@ -0,0 +1,280 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_ARRAY_ND4J_GRAPH_H_
|
||||
#define FLATBUFFERS_GENERATED_ARRAY_ND4J_GRAPH_H_
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
namespace sd {
|
||||
namespace graph {
|
||||
|
||||
struct FlatArray;
|
||||
|
||||
enum ByteOrder {
|
||||
ByteOrder_LE = 0,
|
||||
ByteOrder_BE = 1,
|
||||
ByteOrder_MIN = ByteOrder_LE,
|
||||
ByteOrder_MAX = ByteOrder_BE
|
||||
};
|
||||
|
||||
inline const ByteOrder (&EnumValuesByteOrder())[2] {
|
||||
static const ByteOrder values[] = {
|
||||
ByteOrder_LE,
|
||||
ByteOrder_BE
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char * const *EnumNamesByteOrder() {
|
||||
static const char * const names[] = {
|
||||
"LE",
|
||||
"BE",
|
||||
nullptr
|
||||
};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameByteOrder(ByteOrder e) {
|
||||
const size_t index = static_cast<int>(e);
|
||||
return EnumNamesByteOrder()[index];
|
||||
}
|
||||
|
||||
enum DType {
|
||||
DType_INHERIT = 0,
|
||||
DType_BOOL = 1,
|
||||
DType_FLOAT8 = 2,
|
||||
DType_HALF = 3,
|
||||
DType_HALF2 = 4,
|
||||
DType_FLOAT = 5,
|
||||
DType_DOUBLE = 6,
|
||||
DType_INT8 = 7,
|
||||
DType_INT16 = 8,
|
||||
DType_INT32 = 9,
|
||||
DType_INT64 = 10,
|
||||
DType_UINT8 = 11,
|
||||
DType_UINT16 = 12,
|
||||
DType_UINT32 = 13,
|
||||
DType_UINT64 = 14,
|
||||
DType_QINT8 = 15,
|
||||
DType_QINT16 = 16,
|
||||
DType_BFLOAT16 = 17,
|
||||
DType_UTF8 = 50,
|
||||
DType_UTF16 = 51,
|
||||
DType_UTF32 = 52,
|
||||
DType_MIN = DType_INHERIT,
|
||||
DType_MAX = DType_UTF32
|
||||
};
|
||||
|
||||
inline const DType (&EnumValuesDType())[21] {
|
||||
static const DType values[] = {
|
||||
DType_INHERIT,
|
||||
DType_BOOL,
|
||||
DType_FLOAT8,
|
||||
DType_HALF,
|
||||
DType_HALF2,
|
||||
DType_FLOAT,
|
||||
DType_DOUBLE,
|
||||
DType_INT8,
|
||||
DType_INT16,
|
||||
DType_INT32,
|
||||
DType_INT64,
|
||||
DType_UINT8,
|
||||
DType_UINT16,
|
||||
DType_UINT32,
|
||||
DType_UINT64,
|
||||
DType_QINT8,
|
||||
DType_QINT16,
|
||||
DType_BFLOAT16,
|
||||
DType_UTF8,
|
||||
DType_UTF16,
|
||||
DType_UTF32
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char * const *EnumNamesDType() {
|
||||
static const char * const names[] = {
|
||||
"INHERIT",
|
||||
"BOOL",
|
||||
"FLOAT8",
|
||||
"HALF",
|
||||
"HALF2",
|
||||
"FLOAT",
|
||||
"DOUBLE",
|
||||
"INT8",
|
||||
"INT16",
|
||||
"INT32",
|
||||
"INT64",
|
||||
"UINT8",
|
||||
"UINT16",
|
||||
"UINT32",
|
||||
"UINT64",
|
||||
"QINT8",
|
||||
"QINT16",
|
||||
"BFLOAT16",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"UTF8",
|
||||
"UTF16",
|
||||
"UTF32",
|
||||
nullptr
|
||||
};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameDType(DType e) {
|
||||
const size_t index = static_cast<int>(e);
|
||||
return EnumNamesDType()[index];
|
||||
}
|
||||
|
||||
struct FlatArray FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
enum {
|
||||
VT_SHAPE = 4,
|
||||
VT_BUFFER = 6,
|
||||
VT_DTYPE = 8,
|
||||
VT_BYTEORDER = 10
|
||||
};
|
||||
const flatbuffers::Vector<int64_t> *shape() const {
|
||||
return GetPointer<const flatbuffers::Vector<int64_t> *>(VT_SHAPE);
|
||||
}
|
||||
const flatbuffers::Vector<int8_t> *buffer() const {
|
||||
return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_BUFFER);
|
||||
}
|
||||
DType dtype() const {
|
||||
return static_cast<DType>(GetField<int8_t>(VT_DTYPE, 0));
|
||||
}
|
||||
ByteOrder byteOrder() const {
|
||||
return static_cast<ByteOrder>(GetField<int8_t>(VT_BYTEORDER, 0));
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyOffset(verifier, VT_SHAPE) &&
|
||||
verifier.VerifyVector(shape()) &&
|
||||
VerifyOffset(verifier, VT_BUFFER) &&
|
||||
verifier.VerifyVector(buffer()) &&
|
||||
VerifyField<int8_t>(verifier, VT_DTYPE) &&
|
||||
VerifyField<int8_t>(verifier, VT_BYTEORDER) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct FlatArrayBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_shape(flatbuffers::Offset<flatbuffers::Vector<int64_t>> shape) {
|
||||
fbb_.AddOffset(FlatArray::VT_SHAPE, shape);
|
||||
}
|
||||
void add_buffer(flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer) {
|
||||
fbb_.AddOffset(FlatArray::VT_BUFFER, buffer);
|
||||
}
|
||||
void add_dtype(DType dtype) {
|
||||
fbb_.AddElement<int8_t>(FlatArray::VT_DTYPE, static_cast<int8_t>(dtype), 0);
|
||||
}
|
||||
void add_byteOrder(ByteOrder byteOrder) {
|
||||
fbb_.AddElement<int8_t>(FlatArray::VT_BYTEORDER, static_cast<int8_t>(byteOrder), 0);
|
||||
}
|
||||
explicit FlatArrayBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
FlatArrayBuilder &operator=(const FlatArrayBuilder &);
|
||||
flatbuffers::Offset<FlatArray> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = flatbuffers::Offset<FlatArray>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<FlatArray> CreateFlatArray(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::Vector<int64_t>> shape = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer = 0,
|
||||
DType dtype = DType_INHERIT,
|
||||
ByteOrder byteOrder = ByteOrder_LE) {
|
||||
FlatArrayBuilder builder_(_fbb);
|
||||
builder_.add_buffer(buffer);
|
||||
builder_.add_shape(shape);
|
||||
builder_.add_byteOrder(byteOrder);
|
||||
builder_.add_dtype(dtype);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline flatbuffers::Offset<FlatArray> CreateFlatArrayDirect(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const std::vector<int64_t> *shape = nullptr,
|
||||
const std::vector<int8_t> *buffer = nullptr,
|
||||
DType dtype = DType_INHERIT,
|
||||
ByteOrder byteOrder = ByteOrder_LE) {
|
||||
return sd::graph::CreateFlatArray(
|
||||
_fbb,
|
||||
shape ? _fbb.CreateVector<int64_t>(*shape) : 0,
|
||||
buffer ? _fbb.CreateVector<int8_t>(*buffer) : 0,
|
||||
dtype,
|
||||
byteOrder);
|
||||
}
|
||||
|
||||
inline const sd::graph::FlatArray *GetFlatArray(const void *buf) {
|
||||
return flatbuffers::GetRoot<sd::graph::FlatArray>(buf);
|
||||
}
|
||||
|
||||
inline const sd::graph::FlatArray *GetSizePrefixedFlatArray(const void *buf) {
|
||||
return flatbuffers::GetSizePrefixedRoot<sd::graph::FlatArray>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyFlatArrayBuffer(
|
||||
flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<sd::graph::FlatArray>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedFlatArrayBuffer(
|
||||
flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<sd::graph::FlatArray>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishFlatArrayBuffer(
|
||||
flatbuffers::FlatBufferBuilder &fbb,
|
||||
flatbuffers::Offset<sd::graph::FlatArray> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedFlatArrayBuffer(
|
||||
flatbuffers::FlatBufferBuilder &fbb,
|
||||
flatbuffers::Offset<sd::graph::FlatArray> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace graph
|
||||
} // namespace sd
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_ARRAY_ND4J_GRAPH_H_
|
|
@ -0,0 +1,260 @@
|
|||
/*
|
||||
* ******************************************************************************
|
||||
* *
|
||||
* *
|
||||
* * This program and the accompanying materials are made available under the
|
||||
* * terms of the Apache License, Version 2.0 which is available at
|
||||
* * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
* *
|
||||
* * See the NOTICE file distributed with this work for additional
|
||||
* * information regarding copyright ownership.
|
||||
* * Unless required by applicable law or agreed to in writing, software
|
||||
* * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* * License for the specific language governing permissions and limitations
|
||||
* * under the License.
|
||||
* *
|
||||
* * SPDX-License-Identifier: Apache-2.0
|
||||
* *****************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @namespace
|
||||
*/
|
||||
var nd4j = nd4j || {};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @namespace
|
||||
*/
|
||||
nd4j.graph = nd4j.graph || {};
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
nd4j.graph.ByteOrder = {
|
||||
LE: 0,
|
||||
BE: 1
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
nd4j.graph.DType = {
|
||||
INHERIT: 0,
|
||||
BOOL: 1,
|
||||
FLOAT8: 2,
|
||||
HALF: 3,
|
||||
HALF2: 4,
|
||||
FLOAT: 5,
|
||||
DOUBLE: 6,
|
||||
INT8: 7,
|
||||
INT16: 8,
|
||||
INT32: 9,
|
||||
INT64: 10,
|
||||
UINT8: 11,
|
||||
UINT16: 12,
|
||||
UINT32: 13,
|
||||
UINT64: 14,
|
||||
QINT8: 15,
|
||||
QINT16: 16,
|
||||
BFLOAT16: 17,
|
||||
UTF8: 50,
|
||||
UTF16: 51,
|
||||
UTF32: 52
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
nd4j.graph.FlatArray = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {nd4j.graph.FlatArray}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {nd4j.graph.FlatArray=} obj
|
||||
* @returns {nd4j.graph.FlatArray}
|
||||
*/
|
||||
nd4j.graph.FlatArray.getRootAsFlatArray = function(bb, obj) {
|
||||
return (obj || new nd4j.graph.FlatArray).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {flatbuffers.Long}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.shape = function(index) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : this.bb.createLong(0, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.shapeLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.buffer = function(index) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.bufferLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {Int8Array}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.bufferArray = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {nd4j.graph.DType}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.dtype = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? /** @type {nd4j.graph.DType} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.DType.INHERIT;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {nd4j.graph.ByteOrder}
|
||||
*/
|
||||
nd4j.graph.FlatArray.prototype.byteOrder = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? /** @type {nd4j.graph.ByteOrder} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.ByteOrder.LE;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
nd4j.graph.FlatArray.startFlatArray = function(builder) {
|
||||
builder.startObject(4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} shapeOffset
|
||||
*/
|
||||
nd4j.graph.FlatArray.addShape = function(builder, shapeOffset) {
|
||||
builder.addFieldOffset(0, shapeOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Long>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatArray.createShapeVector = function(builder, data) {
|
||||
builder.startVector(8, data.length, 8);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addInt64(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatArray.startShapeVector = function(builder, numElems) {
|
||||
builder.startVector(8, numElems, 8);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} bufferOffset
|
||||
*/
|
||||
nd4j.graph.FlatArray.addBuffer = function(builder, bufferOffset) {
|
||||
builder.addFieldOffset(1, bufferOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<number>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatArray.createBufferVector = function(builder, data) {
|
||||
builder.startVector(1, data.length, 1);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addInt8(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatArray.startBufferVector = function(builder, numElems) {
|
||||
builder.startVector(1, numElems, 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {nd4j.graph.DType} dtype
|
||||
*/
|
||||
nd4j.graph.FlatArray.addDtype = function(builder, dtype) {
|
||||
builder.addFieldInt8(2, dtype, nd4j.graph.DType.INHERIT);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {nd4j.graph.ByteOrder} byteOrder
|
||||
*/
|
||||
nd4j.graph.FlatArray.addByteOrder = function(builder, byteOrder) {
|
||||
builder.addFieldInt8(3, byteOrder, nd4j.graph.ByteOrder.LE);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatArray.endFlatArray = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} offset
|
||||
*/
|
||||
nd4j.graph.FlatArray.finishFlatArrayBuffer = function(builder, offset) {
|
||||
builder.finish(offset);
|
||||
};
|
||||
|
||||
// Exports for Node.js and RequireJS
|
||||
this.nd4j = nd4j;
|
|
@ -0,0 +1,294 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_CONFIG_ND4J_GRAPH_H_
|
||||
#define FLATBUFFERS_GENERATED_CONFIG_ND4J_GRAPH_H_
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
namespace sd {
|
||||
namespace graph {
|
||||
|
||||
struct FlatConfiguration;
|
||||
|
||||
enum ProfilingMode {
|
||||
ProfilingMode_NONE = 0,
|
||||
ProfilingMode_NAN_PANIC = 1,
|
||||
ProfilingMode_INF_PANIC = 2,
|
||||
ProfilingMode_ANY_PANIC = 3,
|
||||
ProfilingMode_MIN = ProfilingMode_NONE,
|
||||
ProfilingMode_MAX = ProfilingMode_ANY_PANIC
|
||||
};
|
||||
|
||||
inline const ProfilingMode (&EnumValuesProfilingMode())[4] {
|
||||
static const ProfilingMode values[] = {
|
||||
ProfilingMode_NONE,
|
||||
ProfilingMode_NAN_PANIC,
|
||||
ProfilingMode_INF_PANIC,
|
||||
ProfilingMode_ANY_PANIC
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char * const *EnumNamesProfilingMode() {
|
||||
static const char * const names[] = {
|
||||
"NONE",
|
||||
"NAN_PANIC",
|
||||
"INF_PANIC",
|
||||
"ANY_PANIC",
|
||||
nullptr
|
||||
};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameProfilingMode(ProfilingMode e) {
|
||||
const size_t index = static_cast<int>(e);
|
||||
return EnumNamesProfilingMode()[index];
|
||||
}
|
||||
|
||||
enum ExecutionMode {
|
||||
ExecutionMode_SEQUENTIAL = 0,
|
||||
ExecutionMode_STRICT = 1,
|
||||
ExecutionMode_AUTO = 2,
|
||||
ExecutionMode_MIN = ExecutionMode_SEQUENTIAL,
|
||||
ExecutionMode_MAX = ExecutionMode_AUTO
|
||||
};
|
||||
|
||||
inline const ExecutionMode (&EnumValuesExecutionMode())[3] {
|
||||
static const ExecutionMode values[] = {
|
||||
ExecutionMode_SEQUENTIAL,
|
||||
ExecutionMode_STRICT,
|
||||
ExecutionMode_AUTO
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char * const *EnumNamesExecutionMode() {
|
||||
static const char * const names[] = {
|
||||
"SEQUENTIAL",
|
||||
"STRICT",
|
||||
"AUTO",
|
||||
nullptr
|
||||
};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameExecutionMode(ExecutionMode e) {
|
||||
const size_t index = static_cast<int>(e);
|
||||
return EnumNamesExecutionMode()[index];
|
||||
}
|
||||
|
||||
enum OutputMode {
|
||||
OutputMode_IMPLICIT = 0,
|
||||
OutputMode_EXPLICIT = 1,
|
||||
OutputMode_EXPLICIT_AND_IMPLICIT = 2,
|
||||
OutputMode_VARIABLE_SPACE = 3,
|
||||
OutputMode_OPTIMIZED = 4,
|
||||
OutputMode_MIN = OutputMode_IMPLICIT,
|
||||
OutputMode_MAX = OutputMode_OPTIMIZED
|
||||
};
|
||||
|
||||
inline const OutputMode (&EnumValuesOutputMode())[5] {
|
||||
static const OutputMode values[] = {
|
||||
OutputMode_IMPLICIT,
|
||||
OutputMode_EXPLICIT,
|
||||
OutputMode_EXPLICIT_AND_IMPLICIT,
|
||||
OutputMode_VARIABLE_SPACE,
|
||||
OutputMode_OPTIMIZED
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char * const *EnumNamesOutputMode() {
|
||||
static const char * const names[] = {
|
||||
"IMPLICIT",
|
||||
"EXPLICIT",
|
||||
"EXPLICIT_AND_IMPLICIT",
|
||||
"VARIABLE_SPACE",
|
||||
"OPTIMIZED",
|
||||
nullptr
|
||||
};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameOutputMode(OutputMode e) {
|
||||
const size_t index = static_cast<int>(e);
|
||||
return EnumNamesOutputMode()[index];
|
||||
}
|
||||
|
||||
enum Direction {
|
||||
Direction_FORWARD_ONLY = 0,
|
||||
Direction_FORWARD_AND_BACKWARD = 1,
|
||||
Direction_BACKWARD_ONLY = 2,
|
||||
Direction_MIN = Direction_FORWARD_ONLY,
|
||||
Direction_MAX = Direction_BACKWARD_ONLY
|
||||
};
|
||||
|
||||
inline const Direction (&EnumValuesDirection())[3] {
|
||||
static const Direction values[] = {
|
||||
Direction_FORWARD_ONLY,
|
||||
Direction_FORWARD_AND_BACKWARD,
|
||||
Direction_BACKWARD_ONLY
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char * const *EnumNamesDirection() {
|
||||
static const char * const names[] = {
|
||||
"FORWARD_ONLY",
|
||||
"FORWARD_AND_BACKWARD",
|
||||
"BACKWARD_ONLY",
|
||||
nullptr
|
||||
};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameDirection(Direction e) {
|
||||
const size_t index = static_cast<int>(e);
|
||||
return EnumNamesDirection()[index];
|
||||
}
|
||||
|
||||
struct FlatConfiguration FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
enum {
|
||||
VT_ID = 4,
|
||||
VT_EXECUTIONMODE = 6,
|
||||
VT_PROFILINGMODE = 8,
|
||||
VT_OUTPUTMODE = 10,
|
||||
VT_TIMESTATS = 12,
|
||||
VT_FOOTPRINTFORWARD = 14,
|
||||
VT_FOOTPRINTBACKWARD = 16,
|
||||
VT_DIRECTION = 18
|
||||
};
|
||||
int64_t id() const {
|
||||
return GetField<int64_t>(VT_ID, 0);
|
||||
}
|
||||
ExecutionMode executionMode() const {
|
||||
return static_cast<ExecutionMode>(GetField<int8_t>(VT_EXECUTIONMODE, 0));
|
||||
}
|
||||
ProfilingMode profilingMode() const {
|
||||
return static_cast<ProfilingMode>(GetField<int8_t>(VT_PROFILINGMODE, 0));
|
||||
}
|
||||
OutputMode outputMode() const {
|
||||
return static_cast<OutputMode>(GetField<int8_t>(VT_OUTPUTMODE, 0));
|
||||
}
|
||||
bool timestats() const {
|
||||
return GetField<uint8_t>(VT_TIMESTATS, 0) != 0;
|
||||
}
|
||||
int64_t footprintForward() const {
|
||||
return GetField<int64_t>(VT_FOOTPRINTFORWARD, 0);
|
||||
}
|
||||
int64_t footprintBackward() const {
|
||||
return GetField<int64_t>(VT_FOOTPRINTBACKWARD, 0);
|
||||
}
|
||||
Direction direction() const {
|
||||
return static_cast<Direction>(GetField<int8_t>(VT_DIRECTION, 0));
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int64_t>(verifier, VT_ID) &&
|
||||
VerifyField<int8_t>(verifier, VT_EXECUTIONMODE) &&
|
||||
VerifyField<int8_t>(verifier, VT_PROFILINGMODE) &&
|
||||
VerifyField<int8_t>(verifier, VT_OUTPUTMODE) &&
|
||||
VerifyField<uint8_t>(verifier, VT_TIMESTATS) &&
|
||||
VerifyField<int64_t>(verifier, VT_FOOTPRINTFORWARD) &&
|
||||
VerifyField<int64_t>(verifier, VT_FOOTPRINTBACKWARD) &&
|
||||
VerifyField<int8_t>(verifier, VT_DIRECTION) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct FlatConfigurationBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_id(int64_t id) {
|
||||
fbb_.AddElement<int64_t>(FlatConfiguration::VT_ID, id, 0);
|
||||
}
|
||||
void add_executionMode(ExecutionMode executionMode) {
|
||||
fbb_.AddElement<int8_t>(FlatConfiguration::VT_EXECUTIONMODE, static_cast<int8_t>(executionMode), 0);
|
||||
}
|
||||
void add_profilingMode(ProfilingMode profilingMode) {
|
||||
fbb_.AddElement<int8_t>(FlatConfiguration::VT_PROFILINGMODE, static_cast<int8_t>(profilingMode), 0);
|
||||
}
|
||||
void add_outputMode(OutputMode outputMode) {
|
||||
fbb_.AddElement<int8_t>(FlatConfiguration::VT_OUTPUTMODE, static_cast<int8_t>(outputMode), 0);
|
||||
}
|
||||
void add_timestats(bool timestats) {
|
||||
fbb_.AddElement<uint8_t>(FlatConfiguration::VT_TIMESTATS, static_cast<uint8_t>(timestats), 0);
|
||||
}
|
||||
void add_footprintForward(int64_t footprintForward) {
|
||||
fbb_.AddElement<int64_t>(FlatConfiguration::VT_FOOTPRINTFORWARD, footprintForward, 0);
|
||||
}
|
||||
void add_footprintBackward(int64_t footprintBackward) {
|
||||
fbb_.AddElement<int64_t>(FlatConfiguration::VT_FOOTPRINTBACKWARD, footprintBackward, 0);
|
||||
}
|
||||
void add_direction(Direction direction) {
|
||||
fbb_.AddElement<int8_t>(FlatConfiguration::VT_DIRECTION, static_cast<int8_t>(direction), 0);
|
||||
}
|
||||
explicit FlatConfigurationBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
FlatConfigurationBuilder &operator=(const FlatConfigurationBuilder &);
|
||||
flatbuffers::Offset<FlatConfiguration> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = flatbuffers::Offset<FlatConfiguration>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<FlatConfiguration> CreateFlatConfiguration(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
ExecutionMode executionMode = ExecutionMode_SEQUENTIAL,
|
||||
ProfilingMode profilingMode = ProfilingMode_NONE,
|
||||
OutputMode outputMode = OutputMode_IMPLICIT,
|
||||
bool timestats = false,
|
||||
int64_t footprintForward = 0,
|
||||
int64_t footprintBackward = 0,
|
||||
Direction direction = Direction_FORWARD_ONLY) {
|
||||
FlatConfigurationBuilder builder_(_fbb);
|
||||
builder_.add_footprintBackward(footprintBackward);
|
||||
builder_.add_footprintForward(footprintForward);
|
||||
builder_.add_id(id);
|
||||
builder_.add_direction(direction);
|
||||
builder_.add_timestats(timestats);
|
||||
builder_.add_outputMode(outputMode);
|
||||
builder_.add_profilingMode(profilingMode);
|
||||
builder_.add_executionMode(executionMode);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline const sd::graph::FlatConfiguration *GetFlatConfiguration(const void *buf) {
|
||||
return flatbuffers::GetRoot<sd::graph::FlatConfiguration>(buf);
|
||||
}
|
||||
|
||||
inline const sd::graph::FlatConfiguration *GetSizePrefixedFlatConfiguration(const void *buf) {
|
||||
return flatbuffers::GetSizePrefixedRoot<sd::graph::FlatConfiguration>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyFlatConfigurationBuffer(
|
||||
flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<sd::graph::FlatConfiguration>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedFlatConfigurationBuffer(
|
||||
flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<sd::graph::FlatConfiguration>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishFlatConfigurationBuffer(
|
||||
flatbuffers::FlatBufferBuilder &fbb,
|
||||
flatbuffers::Offset<sd::graph::FlatConfiguration> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedFlatConfigurationBuffer(
|
||||
flatbuffers::FlatBufferBuilder &fbb,
|
||||
flatbuffers::Offset<sd::graph::FlatConfiguration> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace graph
|
||||
} // namespace sd
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_CONFIG_ND4J_GRAPH_H_
|
|
@ -0,0 +1,260 @@
|
|||
/*
|
||||
* ******************************************************************************
|
||||
* *
|
||||
* *
|
||||
* * This program and the accompanying materials are made available under the
|
||||
* * terms of the Apache License, Version 2.0 which is available at
|
||||
* * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
* *
|
||||
* * See the NOTICE file distributed with this work for additional
|
||||
* * information regarding copyright ownership.
|
||||
* * Unless required by applicable law or agreed to in writing, software
|
||||
* * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* * License for the specific language governing permissions and limitations
|
||||
* * under the License.
|
||||
* *
|
||||
* * SPDX-License-Identifier: Apache-2.0
|
||||
* *****************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @namespace
|
||||
*/
|
||||
var nd4j = nd4j || {};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @namespace
|
||||
*/
|
||||
nd4j.graph = nd4j.graph || {};
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
nd4j.graph.ProfilingMode = {
|
||||
NONE: 0,
|
||||
NAN_PANIC: 1,
|
||||
INF_PANIC: 2,
|
||||
ANY_PANIC: 3
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
nd4j.graph.ExecutionMode = {
|
||||
SEQUENTIAL: 0,
|
||||
STRICT: 1,
|
||||
AUTO: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
nd4j.graph.OutputMode = {
|
||||
IMPLICIT: 0,
|
||||
EXPLICIT: 1,
|
||||
EXPLICIT_AND_IMPLICIT: 2,
|
||||
VARIABLE_SPACE: 3,
|
||||
OPTIMIZED: 4
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
nd4j.graph.Direction = {
|
||||
FORWARD_ONLY: 0,
|
||||
FORWARD_AND_BACKWARD: 1,
|
||||
BACKWARD_ONLY: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {nd4j.graph.FlatConfiguration}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {nd4j.graph.FlatConfiguration=} obj
|
||||
* @returns {nd4j.graph.FlatConfiguration}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.getRootAsFlatConfiguration = function(bb, obj) {
|
||||
return (obj || new nd4j.graph.FlatConfiguration).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {flatbuffers.Long}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.id = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {nd4j.graph.ExecutionMode}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.executionMode = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? /** @type {nd4j.graph.ExecutionMode} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.ExecutionMode.SEQUENTIAL;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {nd4j.graph.ProfilingMode}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.profilingMode = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? /** @type {nd4j.graph.ProfilingMode} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.ProfilingMode.NONE;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {nd4j.graph.OutputMode}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.outputMode = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? /** @type {nd4j.graph.OutputMode} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.OutputMode.IMPLICIT;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.timestats = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {flatbuffers.Long}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.footprintForward = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {flatbuffers.Long}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.footprintBackward = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {nd4j.graph.Direction}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.prototype.direction = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? /** @type {nd4j.graph.Direction} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.Direction.FORWARD_ONLY;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.startFlatConfiguration = function(builder) {
|
||||
builder.startObject(8);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Long} id
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addId = function(builder, id) {
|
||||
builder.addFieldInt64(0, id, builder.createLong(0, 0));
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {nd4j.graph.ExecutionMode} executionMode
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addExecutionMode = function(builder, executionMode) {
|
||||
builder.addFieldInt8(1, executionMode, nd4j.graph.ExecutionMode.SEQUENTIAL);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {nd4j.graph.ProfilingMode} profilingMode
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addProfilingMode = function(builder, profilingMode) {
|
||||
builder.addFieldInt8(2, profilingMode, nd4j.graph.ProfilingMode.NONE);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {nd4j.graph.OutputMode} outputMode
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addOutputMode = function(builder, outputMode) {
|
||||
builder.addFieldInt8(3, outputMode, nd4j.graph.OutputMode.IMPLICIT);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {boolean} timestats
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addTimestats = function(builder, timestats) {
|
||||
builder.addFieldInt8(4, +timestats, +false);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Long} footprintForward
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addFootprintForward = function(builder, footprintForward) {
|
||||
builder.addFieldInt64(5, footprintForward, builder.createLong(0, 0));
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Long} footprintBackward
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addFootprintBackward = function(builder, footprintBackward) {
|
||||
builder.addFieldInt64(6, footprintBackward, builder.createLong(0, 0));
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {nd4j.graph.Direction} direction
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.addDirection = function(builder, direction) {
|
||||
builder.addFieldInt8(7, direction, nd4j.graph.Direction.FORWARD_ONLY);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.endFlatConfiguration = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} offset
|
||||
*/
|
||||
nd4j.graph.FlatConfiguration.finishFlatConfigurationBuffer = function(builder, offset) {
|
||||
builder.finish(offset);
|
||||
};
|
||||
|
||||
// Exports for Node.js and RequireJS
|
||||
this.nd4j = nd4j;
|
|
@ -0,0 +1,143 @@
|
|||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: graph
|
||||
|
||||
#include "graph_generated.h"
|
||||
#include "graph.grpc.fb.h"
|
||||
|
||||
#include <grpc++/impl/codegen/async_stream.h>
|
||||
#include <grpc++/impl/codegen/async_unary_call.h>
|
||||
#include <grpc++/impl/codegen/channel_interface.h>
|
||||
#include <grpc++/impl/codegen/client_unary_call.h>
|
||||
#include <grpc++/impl/codegen/method_handler_impl.h>
|
||||
#include <grpc++/impl/codegen/rpc_service_method.h>
|
||||
#include <grpc++/impl/codegen/service_type.h>
|
||||
#include <grpc++/impl/codegen/sync_stream.h>
|
||||
namespace sd {
|
||||
namespace graph {
|
||||
|
||||
static const char* GraphInferenceServer_method_names[] = {
|
||||
"/nd4j.graph.GraphInferenceServer/RegisterGraph",
|
||||
"/nd4j.graph.GraphInferenceServer/ForgetGraph",
|
||||
"/nd4j.graph.GraphInferenceServer/ReplaceGraph",
|
||||
"/nd4j.graph.GraphInferenceServer/InferenceRequest",
|
||||
};
|
||||
|
||||
std::unique_ptr< GraphInferenceServer::Stub> GraphInferenceServer::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
|
||||
std::unique_ptr< GraphInferenceServer::Stub> stub(new GraphInferenceServer::Stub(channel));
|
||||
return stub;
|
||||
}
|
||||
|
||||
GraphInferenceServer::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel)
|
||||
: channel_(channel) , rpcmethod_RegisterGraph_(GraphInferenceServer_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ForgetGraph_(GraphInferenceServer_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ReplaceGraph_(GraphInferenceServer_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_InferenceRequest_(GraphInferenceServer_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
{}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Stub::RegisterGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, flatbuffers::grpc::Message<FlatResponse>* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_RegisterGraph_, context, request, response);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* GraphInferenceServer::Stub::AsyncRegisterGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResponse>>::Create(channel_.get(), cq, rpcmethod_RegisterGraph_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* GraphInferenceServer::Stub::PrepareAsyncRegisterGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResponse>>::Create(channel_.get(), cq, rpcmethod_RegisterGraph_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Stub::ForgetGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, flatbuffers::grpc::Message<FlatResponse>* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ForgetGraph_, context, request, response);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* GraphInferenceServer::Stub::AsyncForgetGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResponse>>::Create(channel_.get(), cq, rpcmethod_ForgetGraph_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* GraphInferenceServer::Stub::PrepareAsyncForgetGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResponse>>::Create(channel_.get(), cq, rpcmethod_ForgetGraph_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Stub::ReplaceGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, flatbuffers::grpc::Message<FlatResponse>* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ReplaceGraph_, context, request, response);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* GraphInferenceServer::Stub::AsyncReplaceGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResponse>>::Create(channel_.get(), cq, rpcmethod_ReplaceGraph_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* GraphInferenceServer::Stub::PrepareAsyncReplaceGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResponse>>::Create(channel_.get(), cq, rpcmethod_ReplaceGraph_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Stub::InferenceRequest(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, flatbuffers::grpc::Message<FlatResult>* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_InferenceRequest_, context, request, response);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>* GraphInferenceServer::Stub::AsyncInferenceRequestRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResult>>::Create(channel_.get(), cq, rpcmethod_InferenceRequest_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>* GraphInferenceServer::Stub::PrepareAsyncInferenceRequestRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<FlatResult>>::Create(channel_.get(), cq, rpcmethod_InferenceRequest_, context, request, false);
|
||||
}
|
||||
|
||||
GraphInferenceServer::Service::Service() {
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
GraphInferenceServer_method_names[0],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< GraphInferenceServer::Service, flatbuffers::grpc::Message<FlatGraph>, flatbuffers::grpc::Message<FlatResponse>>(
|
||||
std::mem_fn(&GraphInferenceServer::Service::RegisterGraph), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
GraphInferenceServer_method_names[1],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< GraphInferenceServer::Service, flatbuffers::grpc::Message<FlatDropRequest>, flatbuffers::grpc::Message<FlatResponse>>(
|
||||
std::mem_fn(&GraphInferenceServer::Service::ForgetGraph), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
GraphInferenceServer_method_names[2],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< GraphInferenceServer::Service, flatbuffers::grpc::Message<FlatGraph>, flatbuffers::grpc::Message<FlatResponse>>(
|
||||
std::mem_fn(&GraphInferenceServer::Service::ReplaceGraph), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
GraphInferenceServer_method_names[3],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< GraphInferenceServer::Service, flatbuffers::grpc::Message<FlatInferenceRequest>, flatbuffers::grpc::Message<FlatResult>>(
|
||||
std::mem_fn(&GraphInferenceServer::Service::InferenceRequest), this)));
|
||||
}
|
||||
|
||||
GraphInferenceServer::Service::~Service() {
|
||||
}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Service::RegisterGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Service::ForgetGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatDropRequest>* request, flatbuffers::grpc::Message<FlatResponse>* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Service::ReplaceGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status GraphInferenceServer::Service::InferenceRequest(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>* request, flatbuffers::grpc::Message<FlatResult>* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
|
||||
} // namespace sd
|
||||
} // namespace graph
|
||||
|
|
@ -0,0 +1,372 @@
|
|||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: graph
|
||||
#ifndef GRPC_graph__INCLUDED
|
||||
#define GRPC_graph__INCLUDED
|
||||
|
||||
#include "graph_generated.h"
|
||||
#include "flatbuffers/grpc.h"
|
||||
|
||||
#include <grpc++/impl/codegen/async_stream.h>
|
||||
#include <grpc++/impl/codegen/async_unary_call.h>
|
||||
#include <grpc++/impl/codegen/method_handler_impl.h>
|
||||
#include <grpc++/impl/codegen/proto_utils.h>
|
||||
#include <grpc++/impl/codegen/rpc_method.h>
|
||||
#include <grpc++/impl/codegen/service_type.h>
|
||||
#include <grpc++/impl/codegen/status.h>
|
||||
#include <grpc++/impl/codegen/stub_options.h>
|
||||
#include <grpc++/impl/codegen/sync_stream.h>
|
||||
|
||||
namespace grpc {
|
||||
class CompletionQueue;
|
||||
class Channel;
|
||||
class ServerCompletionQueue;
|
||||
class ServerContext;
|
||||
} // namespace grpc
|
||||
|
||||
namespace sd {
|
||||
namespace graph {
|
||||
|
||||
class GraphInferenceServer final {
|
||||
public:
|
||||
static constexpr char const* service_full_name() {
|
||||
return "nd4j.graph.GraphInferenceServer";
|
||||
}
|
||||
class StubInterface {
|
||||
public:
|
||||
virtual ~StubInterface() {}
|
||||
virtual ::grpc::Status RegisterGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, flatbuffers::grpc::Message<FlatResponse>* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>> AsyncRegisterGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>>(AsyncRegisterGraphRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>> PrepareAsyncRegisterGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>>(PrepareAsyncRegisterGraphRaw(context, request, cq));
|
||||
}
|
||||
virtual ::grpc::Status ForgetGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, flatbuffers::grpc::Message<FlatResponse>* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>> AsyncForgetGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>>(AsyncForgetGraphRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>> PrepareAsyncForgetGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>>(PrepareAsyncForgetGraphRaw(context, request, cq));
|
||||
}
|
||||
virtual ::grpc::Status ReplaceGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, flatbuffers::grpc::Message<FlatResponse>* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>> AsyncReplaceGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>>(AsyncReplaceGraphRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>> PrepareAsyncReplaceGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>>(PrepareAsyncReplaceGraphRaw(context, request, cq));
|
||||
}
|
||||
virtual ::grpc::Status InferenceRequest(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, flatbuffers::grpc::Message<FlatResult>* response) = 0;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResult>>> AsyncInferenceRequest(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResult>>>(AsyncInferenceRequestRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResult>>> PrepareAsyncInferenceRequest(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResult>>>(PrepareAsyncInferenceRequestRaw(context, request, cq));
|
||||
}
|
||||
private:
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>* AsyncRegisterGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>* PrepareAsyncRegisterGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>* AsyncForgetGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>* PrepareAsyncForgetGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>* AsyncReplaceGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResponse>>* PrepareAsyncReplaceGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResult>>* AsyncInferenceRequestRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message<FlatResult>>* PrepareAsyncInferenceRequestRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) = 0;
|
||||
};
|
||||
class Stub final : public StubInterface {
|
||||
public:
|
||||
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel);
|
||||
::grpc::Status RegisterGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, flatbuffers::grpc::Message<FlatResponse>* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>> AsyncRegisterGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>>(AsyncRegisterGraphRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>> PrepareAsyncRegisterGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>>(PrepareAsyncRegisterGraphRaw(context, request, cq));
|
||||
}
|
||||
::grpc::Status ForgetGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, flatbuffers::grpc::Message<FlatResponse>* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>> AsyncForgetGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>>(AsyncForgetGraphRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>> PrepareAsyncForgetGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>>(PrepareAsyncForgetGraphRaw(context, request, cq));
|
||||
}
|
||||
::grpc::Status ReplaceGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, flatbuffers::grpc::Message<FlatResponse>* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>> AsyncReplaceGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>>(AsyncReplaceGraphRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>> PrepareAsyncReplaceGraph(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>>(PrepareAsyncReplaceGraphRaw(context, request, cq));
|
||||
}
|
||||
::grpc::Status InferenceRequest(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, flatbuffers::grpc::Message<FlatResult>* response) override;
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>> AsyncInferenceRequest(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>>(AsyncInferenceRequestRaw(context, request, cq));
|
||||
}
|
||||
std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>> PrepareAsyncInferenceRequest(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) {
|
||||
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>>(PrepareAsyncInferenceRequestRaw(context, request, cq));
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr< ::grpc::ChannelInterface> channel_;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* AsyncRegisterGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* PrepareAsyncRegisterGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* AsyncForgetGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* PrepareAsyncForgetGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatDropRequest>& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* AsyncReplaceGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResponse>>* PrepareAsyncReplaceGraphRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatGraph>& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>* AsyncInferenceRequestRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) override;
|
||||
::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<FlatResult>>* PrepareAsyncInferenceRequestRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>& request, ::grpc::CompletionQueue* cq) override;
|
||||
const ::grpc::internal::RpcMethod rpcmethod_RegisterGraph_;
|
||||
const ::grpc::internal::RpcMethod rpcmethod_ForgetGraph_;
|
||||
const ::grpc::internal::RpcMethod rpcmethod_ReplaceGraph_;
|
||||
const ::grpc::internal::RpcMethod rpcmethod_InferenceRequest_;
|
||||
};
|
||||
static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
|
||||
|
||||
class Service : public ::grpc::Service {
|
||||
public:
|
||||
Service();
|
||||
virtual ~Service();
|
||||
virtual ::grpc::Status RegisterGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response);
|
||||
virtual ::grpc::Status ForgetGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatDropRequest>* request, flatbuffers::grpc::Message<FlatResponse>* response);
|
||||
virtual ::grpc::Status ReplaceGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response);
|
||||
virtual ::grpc::Status InferenceRequest(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>* request, flatbuffers::grpc::Message<FlatResult>* response);
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithAsyncMethod_RegisterGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithAsyncMethod_RegisterGraph() {
|
||||
::grpc::Service::MarkMethodAsync(0);
|
||||
}
|
||||
~WithAsyncMethod_RegisterGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status RegisterGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
void RequestRegisterGraph(::grpc::ServerContext* context, flatbuffers::grpc::Message<FlatGraph>* request, ::grpc::ServerAsyncResponseWriter< flatbuffers::grpc::Message<FlatResponse>>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
||||
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
|
||||
}
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithAsyncMethod_ForgetGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithAsyncMethod_ForgetGraph() {
|
||||
::grpc::Service::MarkMethodAsync(1);
|
||||
}
|
||||
~WithAsyncMethod_ForgetGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status ForgetGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatDropRequest>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
void RequestForgetGraph(::grpc::ServerContext* context, flatbuffers::grpc::Message<FlatDropRequest>* request, ::grpc::ServerAsyncResponseWriter< flatbuffers::grpc::Message<FlatResponse>>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
||||
::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag);
|
||||
}
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithAsyncMethod_ReplaceGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithAsyncMethod_ReplaceGraph() {
|
||||
::grpc::Service::MarkMethodAsync(2);
|
||||
}
|
||||
~WithAsyncMethod_ReplaceGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status ReplaceGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
void RequestReplaceGraph(::grpc::ServerContext* context, flatbuffers::grpc::Message<FlatGraph>* request, ::grpc::ServerAsyncResponseWriter< flatbuffers::grpc::Message<FlatResponse>>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
||||
::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag);
|
||||
}
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithAsyncMethod_InferenceRequest : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithAsyncMethod_InferenceRequest() {
|
||||
::grpc::Service::MarkMethodAsync(3);
|
||||
}
|
||||
~WithAsyncMethod_InferenceRequest() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status InferenceRequest(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>* request, flatbuffers::grpc::Message<FlatResult>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
void RequestInferenceRequest(::grpc::ServerContext* context, flatbuffers::grpc::Message<FlatInferenceRequest>* request, ::grpc::ServerAsyncResponseWriter< flatbuffers::grpc::Message<FlatResult>>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
|
||||
::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag);
|
||||
}
|
||||
};
|
||||
typedef WithAsyncMethod_RegisterGraph< WithAsyncMethod_ForgetGraph< WithAsyncMethod_ReplaceGraph< WithAsyncMethod_InferenceRequest< Service > > > > AsyncService;
|
||||
template <class BaseClass>
|
||||
class WithGenericMethod_RegisterGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithGenericMethod_RegisterGraph() {
|
||||
::grpc::Service::MarkMethodGeneric(0);
|
||||
}
|
||||
~WithGenericMethod_RegisterGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status RegisterGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithGenericMethod_ForgetGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithGenericMethod_ForgetGraph() {
|
||||
::grpc::Service::MarkMethodGeneric(1);
|
||||
}
|
||||
~WithGenericMethod_ForgetGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status ForgetGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatDropRequest>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithGenericMethod_ReplaceGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithGenericMethod_ReplaceGraph() {
|
||||
::grpc::Service::MarkMethodGeneric(2);
|
||||
}
|
||||
~WithGenericMethod_ReplaceGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status ReplaceGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithGenericMethod_InferenceRequest : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithGenericMethod_InferenceRequest() {
|
||||
::grpc::Service::MarkMethodGeneric(3);
|
||||
}
|
||||
~WithGenericMethod_InferenceRequest() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable synchronous version of this method
|
||||
::grpc::Status InferenceRequest(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>* request, flatbuffers::grpc::Message<FlatResult>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_RegisterGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithStreamedUnaryMethod_RegisterGraph() {
|
||||
::grpc::Service::MarkMethodStreamed(0,
|
||||
new ::grpc::internal::StreamedUnaryHandler< flatbuffers::grpc::Message<FlatGraph>, flatbuffers::grpc::Message<FlatResponse>>(std::bind(&WithStreamedUnaryMethod_RegisterGraph<BaseClass>::StreamedRegisterGraph, this, std::placeholders::_1, std::placeholders::_2)));
|
||||
}
|
||||
~WithStreamedUnaryMethod_RegisterGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable regular version of this method
|
||||
::grpc::Status RegisterGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
// replace default version of method with streamed unary
|
||||
virtual ::grpc::Status StreamedRegisterGraph(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< flatbuffers::grpc::Message<FlatGraph>,flatbuffers::grpc::Message<FlatResponse>>* server_unary_streamer) = 0;
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_ForgetGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithStreamedUnaryMethod_ForgetGraph() {
|
||||
::grpc::Service::MarkMethodStreamed(1,
|
||||
new ::grpc::internal::StreamedUnaryHandler< flatbuffers::grpc::Message<FlatDropRequest>, flatbuffers::grpc::Message<FlatResponse>>(std::bind(&WithStreamedUnaryMethod_ForgetGraph<BaseClass>::StreamedForgetGraph, this, std::placeholders::_1, std::placeholders::_2)));
|
||||
}
|
||||
~WithStreamedUnaryMethod_ForgetGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable regular version of this method
|
||||
::grpc::Status ForgetGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatDropRequest>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
// replace default version of method with streamed unary
|
||||
virtual ::grpc::Status StreamedForgetGraph(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< flatbuffers::grpc::Message<FlatDropRequest>,flatbuffers::grpc::Message<FlatResponse>>* server_unary_streamer) = 0;
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_ReplaceGraph : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithStreamedUnaryMethod_ReplaceGraph() {
|
||||
::grpc::Service::MarkMethodStreamed(2,
|
||||
new ::grpc::internal::StreamedUnaryHandler< flatbuffers::grpc::Message<FlatGraph>, flatbuffers::grpc::Message<FlatResponse>>(std::bind(&WithStreamedUnaryMethod_ReplaceGraph<BaseClass>::StreamedReplaceGraph, this, std::placeholders::_1, std::placeholders::_2)));
|
||||
}
|
||||
~WithStreamedUnaryMethod_ReplaceGraph() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable regular version of this method
|
||||
::grpc::Status ReplaceGraph(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatGraph>* request, flatbuffers::grpc::Message<FlatResponse>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
// replace default version of method with streamed unary
|
||||
virtual ::grpc::Status StreamedReplaceGraph(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< flatbuffers::grpc::Message<FlatGraph>,flatbuffers::grpc::Message<FlatResponse>>* server_unary_streamer) = 0;
|
||||
};
|
||||
template <class BaseClass>
|
||||
class WithStreamedUnaryMethod_InferenceRequest : public BaseClass {
|
||||
private:
|
||||
void BaseClassMustBeDerivedFromService(const Service *service) {}
|
||||
public:
|
||||
WithStreamedUnaryMethod_InferenceRequest() {
|
||||
::grpc::Service::MarkMethodStreamed(3,
|
||||
new ::grpc::internal::StreamedUnaryHandler< flatbuffers::grpc::Message<FlatInferenceRequest>, flatbuffers::grpc::Message<FlatResult>>(std::bind(&WithStreamedUnaryMethod_InferenceRequest<BaseClass>::StreamedInferenceRequest, this, std::placeholders::_1, std::placeholders::_2)));
|
||||
}
|
||||
~WithStreamedUnaryMethod_InferenceRequest() override {
|
||||
BaseClassMustBeDerivedFromService(this);
|
||||
}
|
||||
// disable regular version of this method
|
||||
::grpc::Status InferenceRequest(::grpc::ServerContext* context, const flatbuffers::grpc::Message<FlatInferenceRequest>* request, flatbuffers::grpc::Message<FlatResult>* response) final override {
|
||||
abort();
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
// replace default version of method with streamed unary
|
||||
virtual ::grpc::Status StreamedInferenceRequest(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< flatbuffers::grpc::Message<FlatInferenceRequest>,flatbuffers::grpc::Message<FlatResult>>* server_unary_streamer) = 0;
|
||||
};
|
||||
typedef WithStreamedUnaryMethod_RegisterGraph< WithStreamedUnaryMethod_ForgetGraph< WithStreamedUnaryMethod_ReplaceGraph< WithStreamedUnaryMethod_InferenceRequest< Service > > > > StreamedUnaryService;
|
||||
typedef Service SplitStreamedService;
|
||||
typedef WithStreamedUnaryMethod_RegisterGraph< WithStreamedUnaryMethod_ForgetGraph< WithStreamedUnaryMethod_ReplaceGraph< WithStreamedUnaryMethod_InferenceRequest< Service > > > > StreamedService;
|
||||
};
|
||||
|
||||
} // namespace graph
|
||||
} // namespace sd
|
||||
|
||||
|
||||
#endif // GRPC_graph__INCLUDED
|
|
@ -0,0 +1,377 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_GRAPH_ND4J_GRAPH_H_
|
||||
#define FLATBUFFERS_GENERATED_GRAPH_ND4J_GRAPH_H_
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
#include "array_generated.h"
|
||||
#include "config_generated.h"
|
||||
#include "node_generated.h"
|
||||
#include "properties_generated.h"
|
||||
#include "request_generated.h"
|
||||
#include "result_generated.h"
|
||||
#include "utils_generated.h"
|
||||
#include "variable_generated.h"
|
||||
|
||||
namespace sd {
|
||||
namespace graph {
|
||||
|
||||
struct UpdaterState;
|
||||
|
||||
struct FlatGraph;
|
||||
|
||||
struct FlatDropRequest;
|
||||
|
||||
struct FlatResponse;
|
||||
|
||||
struct UpdaterState FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
enum {
|
||||
VT_PARAMNAME = 4,
|
||||
VT_UPDATERSTATEKEYS = 6,
|
||||
VT_UPDATERSTATEVALUES = 8
|
||||
};
|
||||
const flatbuffers::String *paramName() const {
|
||||
return GetPointer<const flatbuffers::String *>(VT_PARAMNAME);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *updaterStateKeys() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_UPDATERSTATEKEYS);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<FlatArray>> *updaterStateValues() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<FlatArray>> *>(VT_UPDATERSTATEVALUES);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyOffset(verifier, VT_PARAMNAME) &&
|
||||
verifier.VerifyString(paramName()) &&
|
||||
VerifyOffset(verifier, VT_UPDATERSTATEKEYS) &&
|
||||
verifier.VerifyVector(updaterStateKeys()) &&
|
||||
verifier.VerifyVectorOfStrings(updaterStateKeys()) &&
|
||||
VerifyOffset(verifier, VT_UPDATERSTATEVALUES) &&
|
||||
verifier.VerifyVector(updaterStateValues()) &&
|
||||
verifier.VerifyVectorOfTables(updaterStateValues()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct UpdaterStateBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_paramName(flatbuffers::Offset<flatbuffers::String> paramName) {
|
||||
fbb_.AddOffset(UpdaterState::VT_PARAMNAME, paramName);
|
||||
}
|
||||
void add_updaterStateKeys(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> updaterStateKeys) {
|
||||
fbb_.AddOffset(UpdaterState::VT_UPDATERSTATEKEYS, updaterStateKeys);
|
||||
}
|
||||
void add_updaterStateValues(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatArray>>> updaterStateValues) {
|
||||
fbb_.AddOffset(UpdaterState::VT_UPDATERSTATEVALUES, updaterStateValues);
|
||||
}
|
||||
explicit UpdaterStateBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
UpdaterStateBuilder &operator=(const UpdaterStateBuilder &);
|
||||
flatbuffers::Offset<UpdaterState> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = flatbuffers::Offset<UpdaterState>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<UpdaterState> CreateUpdaterState(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
flatbuffers::Offset<flatbuffers::String> paramName = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> updaterStateKeys = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatArray>>> updaterStateValues = 0) {
|
||||
UpdaterStateBuilder builder_(_fbb);
|
||||
builder_.add_updaterStateValues(updaterStateValues);
|
||||
builder_.add_updaterStateKeys(updaterStateKeys);
|
||||
builder_.add_paramName(paramName);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline flatbuffers::Offset<UpdaterState> CreateUpdaterStateDirect(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const char *paramName = nullptr,
|
||||
const std::vector<flatbuffers::Offset<flatbuffers::String>> *updaterStateKeys = nullptr,
|
||||
const std::vector<flatbuffers::Offset<FlatArray>> *updaterStateValues = nullptr) {
|
||||
return sd::graph::CreateUpdaterState(
|
||||
_fbb,
|
||||
paramName ? _fbb.CreateString(paramName) : 0,
|
||||
updaterStateKeys ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*updaterStateKeys) : 0,
|
||||
updaterStateValues ? _fbb.CreateVector<flatbuffers::Offset<FlatArray>>(*updaterStateValues) : 0);
|
||||
}
|
||||
|
||||
struct FlatGraph FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
enum {
|
||||
VT_ID = 4,
|
||||
VT_VARIABLES = 6,
|
||||
VT_NODES = 8,
|
||||
VT_OUTPUTS = 10,
|
||||
VT_CONFIGURATION = 12,
|
||||
VT_PLACEHOLDERS = 14,
|
||||
VT_LOSSVARIABLES = 16,
|
||||
VT_TRAININGCONFIG = 18,
|
||||
VT_UPDATERSTATE = 20
|
||||
};
|
||||
int64_t id() const {
|
||||
return GetField<int64_t>(VT_ID, 0);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<FlatVariable>> *variables() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<FlatVariable>> *>(VT_VARIABLES);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<FlatNode>> *nodes() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<FlatNode>> *>(VT_NODES);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<IntPair>> *outputs() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<IntPair>> *>(VT_OUTPUTS);
|
||||
}
|
||||
const FlatConfiguration *configuration() const {
|
||||
return GetPointer<const FlatConfiguration *>(VT_CONFIGURATION);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *placeholders() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_PLACEHOLDERS);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *lossVariables() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_LOSSVARIABLES);
|
||||
}
|
||||
const flatbuffers::String *trainingConfig() const {
|
||||
return GetPointer<const flatbuffers::String *>(VT_TRAININGCONFIG);
|
||||
}
|
||||
const flatbuffers::Vector<flatbuffers::Offset<UpdaterState>> *updaterState() const {
|
||||
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<UpdaterState>> *>(VT_UPDATERSTATE);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int64_t>(verifier, VT_ID) &&
|
||||
VerifyOffset(verifier, VT_VARIABLES) &&
|
||||
verifier.VerifyVector(variables()) &&
|
||||
verifier.VerifyVectorOfTables(variables()) &&
|
||||
VerifyOffset(verifier, VT_NODES) &&
|
||||
verifier.VerifyVector(nodes()) &&
|
||||
verifier.VerifyVectorOfTables(nodes()) &&
|
||||
VerifyOffset(verifier, VT_OUTPUTS) &&
|
||||
verifier.VerifyVector(outputs()) &&
|
||||
verifier.VerifyVectorOfTables(outputs()) &&
|
||||
VerifyOffset(verifier, VT_CONFIGURATION) &&
|
||||
verifier.VerifyTable(configuration()) &&
|
||||
VerifyOffset(verifier, VT_PLACEHOLDERS) &&
|
||||
verifier.VerifyVector(placeholders()) &&
|
||||
verifier.VerifyVectorOfStrings(placeholders()) &&
|
||||
VerifyOffset(verifier, VT_LOSSVARIABLES) &&
|
||||
verifier.VerifyVector(lossVariables()) &&
|
||||
verifier.VerifyVectorOfStrings(lossVariables()) &&
|
||||
VerifyOffset(verifier, VT_TRAININGCONFIG) &&
|
||||
verifier.VerifyString(trainingConfig()) &&
|
||||
VerifyOffset(verifier, VT_UPDATERSTATE) &&
|
||||
verifier.VerifyVector(updaterState()) &&
|
||||
verifier.VerifyVectorOfTables(updaterState()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct FlatGraphBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_id(int64_t id) {
|
||||
fbb_.AddElement<int64_t>(FlatGraph::VT_ID, id, 0);
|
||||
}
|
||||
void add_variables(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatVariable>>> variables) {
|
||||
fbb_.AddOffset(FlatGraph::VT_VARIABLES, variables);
|
||||
}
|
||||
void add_nodes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatNode>>> nodes) {
|
||||
fbb_.AddOffset(FlatGraph::VT_NODES, nodes);
|
||||
}
|
||||
void add_outputs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<IntPair>>> outputs) {
|
||||
fbb_.AddOffset(FlatGraph::VT_OUTPUTS, outputs);
|
||||
}
|
||||
void add_configuration(flatbuffers::Offset<FlatConfiguration> configuration) {
|
||||
fbb_.AddOffset(FlatGraph::VT_CONFIGURATION, configuration);
|
||||
}
|
||||
void add_placeholders(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> placeholders) {
|
||||
fbb_.AddOffset(FlatGraph::VT_PLACEHOLDERS, placeholders);
|
||||
}
|
||||
void add_lossVariables(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> lossVariables) {
|
||||
fbb_.AddOffset(FlatGraph::VT_LOSSVARIABLES, lossVariables);
|
||||
}
|
||||
void add_trainingConfig(flatbuffers::Offset<flatbuffers::String> trainingConfig) {
|
||||
fbb_.AddOffset(FlatGraph::VT_TRAININGCONFIG, trainingConfig);
|
||||
}
|
||||
void add_updaterState(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<UpdaterState>>> updaterState) {
|
||||
fbb_.AddOffset(FlatGraph::VT_UPDATERSTATE, updaterState);
|
||||
}
|
||||
explicit FlatGraphBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
FlatGraphBuilder &operator=(const FlatGraphBuilder &);
|
||||
flatbuffers::Offset<FlatGraph> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = flatbuffers::Offset<FlatGraph>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<FlatGraph> CreateFlatGraph(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatVariable>>> variables = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatNode>>> nodes = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<IntPair>>> outputs = 0,
|
||||
flatbuffers::Offset<FlatConfiguration> configuration = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> placeholders = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> lossVariables = 0,
|
||||
flatbuffers::Offset<flatbuffers::String> trainingConfig = 0,
|
||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<UpdaterState>>> updaterState = 0) {
|
||||
FlatGraphBuilder builder_(_fbb);
|
||||
builder_.add_id(id);
|
||||
builder_.add_updaterState(updaterState);
|
||||
builder_.add_trainingConfig(trainingConfig);
|
||||
builder_.add_lossVariables(lossVariables);
|
||||
builder_.add_placeholders(placeholders);
|
||||
builder_.add_configuration(configuration);
|
||||
builder_.add_outputs(outputs);
|
||||
builder_.add_nodes(nodes);
|
||||
builder_.add_variables(variables);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline flatbuffers::Offset<FlatGraph> CreateFlatGraphDirect(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
const std::vector<flatbuffers::Offset<FlatVariable>> *variables = nullptr,
|
||||
const std::vector<flatbuffers::Offset<FlatNode>> *nodes = nullptr,
|
||||
const std::vector<flatbuffers::Offset<IntPair>> *outputs = nullptr,
|
||||
flatbuffers::Offset<FlatConfiguration> configuration = 0,
|
||||
const std::vector<flatbuffers::Offset<flatbuffers::String>> *placeholders = nullptr,
|
||||
const std::vector<flatbuffers::Offset<flatbuffers::String>> *lossVariables = nullptr,
|
||||
const char *trainingConfig = nullptr,
|
||||
const std::vector<flatbuffers::Offset<UpdaterState>> *updaterState = nullptr) {
|
||||
return sd::graph::CreateFlatGraph(
|
||||
_fbb,
|
||||
id,
|
||||
variables ? _fbb.CreateVector<flatbuffers::Offset<FlatVariable>>(*variables) : 0,
|
||||
nodes ? _fbb.CreateVector<flatbuffers::Offset<FlatNode>>(*nodes) : 0,
|
||||
outputs ? _fbb.CreateVector<flatbuffers::Offset<IntPair>>(*outputs) : 0,
|
||||
configuration,
|
||||
placeholders ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*placeholders) : 0,
|
||||
lossVariables ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*lossVariables) : 0,
|
||||
trainingConfig ? _fbb.CreateString(trainingConfig) : 0,
|
||||
updaterState ? _fbb.CreateVector<flatbuffers::Offset<UpdaterState>>(*updaterState) : 0);
|
||||
}
|
||||
|
||||
struct FlatDropRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
enum {
|
||||
VT_ID = 4
|
||||
};
|
||||
int64_t id() const {
|
||||
return GetField<int64_t>(VT_ID, 0);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int64_t>(verifier, VT_ID) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct FlatDropRequestBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_id(int64_t id) {
|
||||
fbb_.AddElement<int64_t>(FlatDropRequest::VT_ID, id, 0);
|
||||
}
|
||||
explicit FlatDropRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
FlatDropRequestBuilder &operator=(const FlatDropRequestBuilder &);
|
||||
flatbuffers::Offset<FlatDropRequest> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = flatbuffers::Offset<FlatDropRequest>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<FlatDropRequest> CreateFlatDropRequest(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0) {
|
||||
FlatDropRequestBuilder builder_(_fbb);
|
||||
builder_.add_id(id);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct FlatResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
enum {
|
||||
VT_STATUS = 4
|
||||
};
|
||||
int32_t status() const {
|
||||
return GetField<int32_t>(VT_STATUS, 0);
|
||||
}
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int32_t>(verifier, VT_STATUS) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct FlatResponseBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_status(int32_t status) {
|
||||
fbb_.AddElement<int32_t>(FlatResponse::VT_STATUS, status, 0);
|
||||
}
|
||||
explicit FlatResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
FlatResponseBuilder &operator=(const FlatResponseBuilder &);
|
||||
flatbuffers::Offset<FlatResponse> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = flatbuffers::Offset<FlatResponse>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline flatbuffers::Offset<FlatResponse> CreateFlatResponse(
|
||||
flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int32_t status = 0) {
|
||||
FlatResponseBuilder builder_(_fbb);
|
||||
builder_.add_status(status);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline const sd::graph::FlatGraph *GetFlatGraph(const void *buf) {
|
||||
return flatbuffers::GetRoot<sd::graph::FlatGraph>(buf);
|
||||
}
|
||||
|
||||
inline const sd::graph::FlatGraph *GetSizePrefixedFlatGraph(const void *buf) {
|
||||
return flatbuffers::GetSizePrefixedRoot<sd::graph::FlatGraph>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyFlatGraphBuffer(
|
||||
flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<sd::graph::FlatGraph>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedFlatGraphBuffer(
|
||||
flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<sd::graph::FlatGraph>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishFlatGraphBuffer(
|
||||
flatbuffers::FlatBufferBuilder &fbb,
|
||||
flatbuffers::Offset<sd::graph::FlatGraph> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedFlatGraphBuffer(
|
||||
flatbuffers::FlatBufferBuilder &fbb,
|
||||
flatbuffers::Offset<sd::graph::FlatGraph> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace graph
|
||||
} // namespace sd
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_GRAPH_ND4J_GRAPH_H_
|
|
@ -0,0 +1,721 @@
|
|||
/*
|
||||
* ******************************************************************************
|
||||
* *
|
||||
* *
|
||||
* * This program and the accompanying materials are made available under the
|
||||
* * terms of the Apache License, Version 2.0 which is available at
|
||||
* * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
* *
|
||||
* * See the NOTICE file distributed with this work for additional
|
||||
* * information regarding copyright ownership.
|
||||
* * Unless required by applicable law or agreed to in writing, software
|
||||
* * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* * License for the specific language governing permissions and limitations
|
||||
* * under the License.
|
||||
* *
|
||||
* * SPDX-License-Identifier: Apache-2.0
|
||||
* *****************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @namespace
|
||||
*/
|
||||
var nd4j = nd4j || {};
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @namespace
|
||||
*/
|
||||
nd4j.graph = nd4j.graph || {};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
nd4j.graph.UpdaterState = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {nd4j.graph.UpdaterState}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {nd4j.graph.UpdaterState=} obj
|
||||
* @returns {nd4j.graph.UpdaterState}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.getRootAsUpdaterState = function(bb, obj) {
|
||||
return (obj || new nd4j.graph.UpdaterState).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Encoding=} optionalEncoding
|
||||
* @returns {string|Uint8Array|null}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.prototype.paramName = function(optionalEncoding) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {flatbuffers.Encoding=} optionalEncoding
|
||||
* @returns {string|Uint8Array}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.prototype.updaterStateKeys = function(index, optionalEncoding) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.prototype.updaterStateKeysLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {nd4j.graph.FlatArray=} obj
|
||||
* @returns {nd4j.graph.FlatArray}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.prototype.updaterStateValues = function(index, obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? (obj || new nd4j.graph.FlatArray).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.prototype.updaterStateValuesLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
nd4j.graph.UpdaterState.startUpdaterState = function(builder) {
|
||||
builder.startObject(3);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} paramNameOffset
|
||||
*/
|
||||
nd4j.graph.UpdaterState.addParamName = function(builder, paramNameOffset) {
|
||||
builder.addFieldOffset(0, paramNameOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} updaterStateKeysOffset
|
||||
*/
|
||||
nd4j.graph.UpdaterState.addUpdaterStateKeys = function(builder, updaterStateKeysOffset) {
|
||||
builder.addFieldOffset(1, updaterStateKeysOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.createUpdaterStateKeysVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.UpdaterState.startUpdaterStateKeysVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} updaterStateValuesOffset
|
||||
*/
|
||||
nd4j.graph.UpdaterState.addUpdaterStateValues = function(builder, updaterStateValuesOffset) {
|
||||
builder.addFieldOffset(2, updaterStateValuesOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.createUpdaterStateValuesVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.UpdaterState.startUpdaterStateValuesVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.UpdaterState.endUpdaterState = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
nd4j.graph.FlatGraph = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {nd4j.graph.FlatGraph}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {nd4j.graph.FlatGraph=} obj
|
||||
* @returns {nd4j.graph.FlatGraph}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.getRootAsFlatGraph = function(bb, obj) {
|
||||
return (obj || new nd4j.graph.FlatGraph).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {flatbuffers.Long}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.id = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {nd4j.graph.FlatVariable=} obj
|
||||
* @returns {nd4j.graph.FlatVariable}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.variables = function(index, obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new nd4j.graph.FlatVariable).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.variablesLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {nd4j.graph.FlatNode=} obj
|
||||
* @returns {nd4j.graph.FlatNode}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.nodes = function(index, obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? (obj || new nd4j.graph.FlatNode).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.nodesLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {nd4j.graph.IntPair=} obj
|
||||
* @returns {nd4j.graph.IntPair}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.outputs = function(index, obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? (obj || new nd4j.graph.IntPair).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.outputsLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {nd4j.graph.FlatConfiguration=} obj
|
||||
* @returns {nd4j.graph.FlatConfiguration|null}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.configuration = function(obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? (obj || new nd4j.graph.FlatConfiguration).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {flatbuffers.Encoding=} optionalEncoding
|
||||
* @returns {string|Uint8Array}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.placeholders = function(index, optionalEncoding) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.placeholdersLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {flatbuffers.Encoding=} optionalEncoding
|
||||
* @returns {string|Uint8Array}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.lossVariables = function(index, optionalEncoding) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.lossVariablesLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Encoding=} optionalEncoding
|
||||
* @returns {string|Uint8Array|null}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.trainingConfig = function(optionalEncoding) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @param {nd4j.graph.UpdaterState=} obj
|
||||
* @returns {nd4j.graph.UpdaterState}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.updaterState = function(index, obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 20);
|
||||
return offset ? (obj || new nd4j.graph.UpdaterState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.prototype.updaterStateLength = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 20);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
nd4j.graph.FlatGraph.startFlatGraph = function(builder) {
|
||||
builder.startObject(9);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Long} id
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addId = function(builder, id) {
|
||||
builder.addFieldInt64(0, id, builder.createLong(0, 0));
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} variablesOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addVariables = function(builder, variablesOffset) {
|
||||
builder.addFieldOffset(1, variablesOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.createVariablesVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatGraph.startVariablesVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} nodesOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addNodes = function(builder, nodesOffset) {
|
||||
builder.addFieldOffset(2, nodesOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.createNodesVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatGraph.startNodesVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} outputsOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addOutputs = function(builder, outputsOffset) {
|
||||
builder.addFieldOffset(3, outputsOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.createOutputsVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatGraph.startOutputsVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} configurationOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addConfiguration = function(builder, configurationOffset) {
|
||||
builder.addFieldOffset(4, configurationOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} placeholdersOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addPlaceholders = function(builder, placeholdersOffset) {
|
||||
builder.addFieldOffset(5, placeholdersOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.createPlaceholdersVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatGraph.startPlaceholdersVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} lossVariablesOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addLossVariables = function(builder, lossVariablesOffset) {
|
||||
builder.addFieldOffset(6, lossVariablesOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.createLossVariablesVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatGraph.startLossVariablesVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} trainingConfigOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addTrainingConfig = function(builder, trainingConfigOffset) {
|
||||
builder.addFieldOffset(7, trainingConfigOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} updaterStateOffset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.addUpdaterState = function(builder, updaterStateOffset) {
|
||||
builder.addFieldOffset(8, updaterStateOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {Array.<flatbuffers.Offset>} data
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.createUpdaterStateVector = function(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (var i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
return builder.endVector();
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} numElems
|
||||
*/
|
||||
nd4j.graph.FlatGraph.startUpdaterStateVector = function(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatGraph.endFlatGraph = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} offset
|
||||
*/
|
||||
nd4j.graph.FlatGraph.finishFlatGraphBuffer = function(builder, offset) {
|
||||
builder.finish(offset);
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
nd4j.graph.FlatDropRequest = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {nd4j.graph.FlatDropRequest}
|
||||
*/
|
||||
nd4j.graph.FlatDropRequest.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {nd4j.graph.FlatDropRequest=} obj
|
||||
* @returns {nd4j.graph.FlatDropRequest}
|
||||
*/
|
||||
nd4j.graph.FlatDropRequest.getRootAsFlatDropRequest = function(bb, obj) {
|
||||
return (obj || new nd4j.graph.FlatDropRequest).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {flatbuffers.Long}
|
||||
*/
|
||||
nd4j.graph.FlatDropRequest.prototype.id = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
nd4j.graph.FlatDropRequest.startFlatDropRequest = function(builder) {
|
||||
builder.startObject(1);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Long} id
|
||||
*/
|
||||
nd4j.graph.FlatDropRequest.addId = function(builder, id) {
|
||||
builder.addFieldInt64(0, id, builder.createLong(0, 0));
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatDropRequest.endFlatDropRequest = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
nd4j.graph.FlatResponse = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {nd4j.graph.FlatResponse}
|
||||
*/
|
||||
nd4j.graph.FlatResponse.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {nd4j.graph.FlatResponse=} obj
|
||||
* @returns {nd4j.graph.FlatResponse}
|
||||
*/
|
||||
nd4j.graph.FlatResponse.getRootAsFlatResponse = function(bb, obj) {
|
||||
return (obj || new nd4j.graph.FlatResponse).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
nd4j.graph.FlatResponse.prototype.status = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
nd4j.graph.FlatResponse.startFlatResponse = function(builder) {
|
||||
builder.startObject(1);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} status
|
||||
*/
|
||||
nd4j.graph.FlatResponse.addStatus = function(builder, status) {
|
||||
builder.addFieldInt32(0, status, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
nd4j.graph.FlatResponse.endFlatResponse = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
// Exports for Node.js and RequireJS
|
||||
this.nd4j = nd4j;
|
|
@ -0,0 +1,18 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum ByteOrder : sbyte
|
||||
{
|
||||
LE = 0,
|
||||
BE = 1,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class ByteOrder {
|
||||
private ByteOrder() { }
|
||||
public static final byte LE = 0;
|
||||
public static final byte BE = 1;
|
||||
|
||||
public static final String[] names = { "LE", "BE", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class ByteOrder(object):
|
||||
LE = 0
|
||||
BE = 1
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum DType : sbyte
|
||||
{
|
||||
INHERIT = 0,
|
||||
BOOL = 1,
|
||||
FLOAT8 = 2,
|
||||
HALF = 3,
|
||||
HALF2 = 4,
|
||||
FLOAT = 5,
|
||||
DOUBLE = 6,
|
||||
INT8 = 7,
|
||||
INT16 = 8,
|
||||
INT32 = 9,
|
||||
INT64 = 10,
|
||||
UINT8 = 11,
|
||||
UINT16 = 12,
|
||||
UINT32 = 13,
|
||||
UINT64 = 14,
|
||||
QINT8 = 15,
|
||||
QINT16 = 16,
|
||||
BFLOAT16 = 17,
|
||||
UTF8 = 50,
|
||||
UTF16 = 51,
|
||||
UTF32 = 52,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class DType {
|
||||
private DType() { }
|
||||
public static final byte INHERIT = 0;
|
||||
public static final byte BOOL = 1;
|
||||
public static final byte FLOAT8 = 2;
|
||||
public static final byte HALF = 3;
|
||||
public static final byte HALF2 = 4;
|
||||
public static final byte FLOAT = 5;
|
||||
public static final byte DOUBLE = 6;
|
||||
public static final byte INT8 = 7;
|
||||
public static final byte INT16 = 8;
|
||||
public static final byte INT32 = 9;
|
||||
public static final byte INT64 = 10;
|
||||
public static final byte UINT8 = 11;
|
||||
public static final byte UINT16 = 12;
|
||||
public static final byte UINT32 = 13;
|
||||
public static final byte UINT64 = 14;
|
||||
public static final byte QINT8 = 15;
|
||||
public static final byte QINT16 = 16;
|
||||
public static final byte BFLOAT16 = 17;
|
||||
public static final byte UTF8 = 50;
|
||||
public static final byte UTF16 = 51;
|
||||
public static final byte UTF32 = 52;
|
||||
|
||||
public static final String[] names = { "INHERIT", "BOOL", "FLOAT8", "HALF", "HALF2", "FLOAT", "DOUBLE", "INT8", "INT16", "INT32", "INT64", "UINT8", "UINT16", "UINT32", "UINT64", "QINT8", "QINT16", "BFLOAT16", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "UTF8", "UTF16", "UTF32", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class DType(object):
|
||||
INHERIT = 0
|
||||
BOOL = 1
|
||||
FLOAT8 = 2
|
||||
HALF = 3
|
||||
HALF2 = 4
|
||||
FLOAT = 5
|
||||
DOUBLE = 6
|
||||
INT8 = 7
|
||||
INT16 = 8
|
||||
INT32 = 9
|
||||
INT64 = 10
|
||||
UINT8 = 11
|
||||
UINT16 = 12
|
||||
UINT32 = 13
|
||||
UINT64 = 14
|
||||
QINT8 = 15
|
||||
QINT16 = 16
|
||||
BFLOAT16 = 17
|
||||
UTF8 = 50
|
||||
UTF16 = 51
|
||||
UTF32 = 52
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum Direction : sbyte
|
||||
{
|
||||
FORWARD_ONLY = 0,
|
||||
FORWARD_AND_BACKWARD = 1,
|
||||
BACKWARD_ONLY = 2,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class Direction {
|
||||
private Direction() { }
|
||||
public static final byte FORWARD_ONLY = 0;
|
||||
public static final byte FORWARD_AND_BACKWARD = 1;
|
||||
public static final byte BACKWARD_ONLY = 2;
|
||||
|
||||
public static final String[] names = { "FORWARD_ONLY", "FORWARD_AND_BACKWARD", "BACKWARD_ONLY", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class Direction(object):
|
||||
FORWARD_ONLY = 0
|
||||
FORWARD_AND_BACKWARD = 1
|
||||
BACKWARD_ONLY = 2
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum ExecutionMode : sbyte
|
||||
{
|
||||
SEQUENTIAL = 0,
|
||||
STRICT = 1,
|
||||
AUTO = 2,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class ExecutionMode {
|
||||
private ExecutionMode() { }
|
||||
public static final byte SEQUENTIAL = 0;
|
||||
public static final byte STRICT = 1;
|
||||
public static final byte AUTO = 2;
|
||||
|
||||
public static final String[] names = { "SEQUENTIAL", "STRICT", "AUTO", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class ExecutionMode(object):
|
||||
SEQUENTIAL = 0
|
||||
STRICT = 1
|
||||
AUTO = 2
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatArray : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatArray GetRootAsFlatArray(ByteBuffer _bb) { return GetRootAsFlatArray(_bb, new FlatArray()); }
|
||||
public static FlatArray GetRootAsFlatArray(ByteBuffer _bb, FlatArray obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatArray __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long Shape(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
|
||||
public int ShapeLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetShapeBytes() { return __p.__vector_as_span(4); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetShapeBytes() { return __p.__vector_as_arraysegment(4); }
|
||||
#endif
|
||||
public long[] GetShapeArray() { return __p.__vector_as_array<long>(4); }
|
||||
public sbyte Buffer(int j) { int o = __p.__offset(6); return o != 0 ? __p.bb.GetSbyte(__p.__vector(o) + j * 1) : (sbyte)0; }
|
||||
public int BufferLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetBufferBytes() { return __p.__vector_as_span(6); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetBufferBytes() { return __p.__vector_as_arraysegment(6); }
|
||||
#endif
|
||||
public sbyte[] GetBufferArray() { return __p.__vector_as_array<sbyte>(6); }
|
||||
public DType Dtype { get { int o = __p.__offset(8); return o != 0 ? (DType)__p.bb.GetSbyte(o + __p.bb_pos) : DType.INHERIT; } }
|
||||
public ByteOrder ByteOrder { get { int o = __p.__offset(10); return o != 0 ? (ByteOrder)__p.bb.GetSbyte(o + __p.bb_pos) : ByteOrder.LE; } }
|
||||
|
||||
public static Offset<FlatArray> CreateFlatArray(FlatBufferBuilder builder,
|
||||
VectorOffset shapeOffset = default(VectorOffset),
|
||||
VectorOffset bufferOffset = default(VectorOffset),
|
||||
DType dtype = DType.INHERIT,
|
||||
ByteOrder byteOrder = ByteOrder.LE) {
|
||||
builder.StartObject(4);
|
||||
FlatArray.AddBuffer(builder, bufferOffset);
|
||||
FlatArray.AddShape(builder, shapeOffset);
|
||||
FlatArray.AddByteOrder(builder, byteOrder);
|
||||
FlatArray.AddDtype(builder, dtype);
|
||||
return FlatArray.EndFlatArray(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatArray(FlatBufferBuilder builder) { builder.StartObject(4); }
|
||||
public static void AddShape(FlatBufferBuilder builder, VectorOffset shapeOffset) { builder.AddOffset(0, shapeOffset.Value, 0); }
|
||||
public static VectorOffset CreateShapeVector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateShapeVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartShapeVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
|
||||
public static void AddBuffer(FlatBufferBuilder builder, VectorOffset bufferOffset) { builder.AddOffset(1, bufferOffset.Value, 0); }
|
||||
public static VectorOffset CreateBufferVector(FlatBufferBuilder builder, sbyte[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddSbyte(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateBufferVectorBlock(FlatBufferBuilder builder, sbyte[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartBufferVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
|
||||
public static void AddDtype(FlatBufferBuilder builder, DType dtype) { builder.AddSbyte(2, (sbyte)dtype, 0); }
|
||||
public static void AddByteOrder(FlatBufferBuilder builder, ByteOrder byteOrder) { builder.AddSbyte(3, (sbyte)byteOrder, 0); }
|
||||
public static Offset<FlatArray> EndFlatArray(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatArray>(o);
|
||||
}
|
||||
public static void FinishFlatArrayBuffer(FlatBufferBuilder builder, Offset<FlatArray> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatArrayBuffer(FlatBufferBuilder builder, Offset<FlatArray> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatArray extends Table {
|
||||
public static FlatArray getRootAsFlatArray(ByteBuffer _bb) { return getRootAsFlatArray(_bb, new FlatArray()); }
|
||||
public static FlatArray getRootAsFlatArray(ByteBuffer _bb, FlatArray obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatArray __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long shape(int j) { int o = __offset(4); return o != 0 ? bb.getLong(__vector(o) + j * 8) : 0; }
|
||||
public int shapeLength() { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer shapeAsByteBuffer() { return __vector_as_bytebuffer(4, 8); }
|
||||
public ByteBuffer shapeInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 4, 8); }
|
||||
public byte buffer(int j) { int o = __offset(6); return o != 0 ? bb.get(__vector(o) + j * 1) : 0; }
|
||||
public int bufferLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer bufferAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
|
||||
public ByteBuffer bufferInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
|
||||
public byte dtype() { int o = __offset(8); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public byte byteOrder() { int o = __offset(10); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
|
||||
public static int createFlatArray(FlatBufferBuilder builder,
|
||||
int shapeOffset,
|
||||
int bufferOffset,
|
||||
byte dtype,
|
||||
byte byteOrder) {
|
||||
builder.startObject(4);
|
||||
FlatArray.addBuffer(builder, bufferOffset);
|
||||
FlatArray.addShape(builder, shapeOffset);
|
||||
FlatArray.addByteOrder(builder, byteOrder);
|
||||
FlatArray.addDtype(builder, dtype);
|
||||
return FlatArray.endFlatArray(builder);
|
||||
}
|
||||
|
||||
public static void startFlatArray(FlatBufferBuilder builder) { builder.startObject(4); }
|
||||
public static void addShape(FlatBufferBuilder builder, int shapeOffset) { builder.addOffset(0, shapeOffset, 0); }
|
||||
public static int createShapeVector(FlatBufferBuilder builder, long[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addLong(data[i]); return builder.endVector(); }
|
||||
public static void startShapeVector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
|
||||
public static void addBuffer(FlatBufferBuilder builder, int bufferOffset) { builder.addOffset(1, bufferOffset, 0); }
|
||||
public static int createBufferVector(FlatBufferBuilder builder, byte[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addByte(data[i]); return builder.endVector(); }
|
||||
public static void startBufferVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
|
||||
public static void addDtype(FlatBufferBuilder builder, byte dtype) { builder.addByte(2, dtype, 0); }
|
||||
public static void addByteOrder(FlatBufferBuilder builder, byte byteOrder) { builder.addByte(3, byteOrder, 0); }
|
||||
public static int endFlatArray(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatArrayBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatArrayBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatArray(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatArray(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatArray()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatArray
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatArray
|
||||
def Shape(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
|
||||
return 0
|
||||
|
||||
# FlatArray
|
||||
def ShapeAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatArray
|
||||
def ShapeLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatArray
|
||||
def Buffer(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
|
||||
return 0
|
||||
|
||||
# FlatArray
|
||||
def BufferAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int8Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatArray
|
||||
def BufferLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatArray
|
||||
def Dtype(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatArray
|
||||
def ByteOrder(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def FlatArrayStart(builder): builder.StartObject(4)
|
||||
def FlatArrayAddShape(builder, shape): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(shape), 0)
|
||||
def FlatArrayStartShapeVector(builder, numElems): return builder.StartVector(8, numElems, 8)
|
||||
def FlatArrayAddBuffer(builder, buffer): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(buffer), 0)
|
||||
def FlatArrayStartBufferVector(builder, numElems): return builder.StartVector(1, numElems, 1)
|
||||
def FlatArrayAddDtype(builder, dtype): builder.PrependInt8Slot(2, dtype, 0)
|
||||
def FlatArrayAddByteOrder(builder, byteOrder): builder.PrependInt8Slot(3, byteOrder, 0)
|
||||
def FlatArrayEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,42 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatArrayList : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatArrayList GetRootAsFlatArrayList(ByteBuffer _bb) { return GetRootAsFlatArrayList(_bb, new FlatArrayList()); }
|
||||
public static FlatArrayList GetRootAsFlatArrayList(ByteBuffer _bb, FlatArrayList obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatArrayList __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public FlatArray? List(int j) { int o = __p.__offset(4); return o != 0 ? (FlatArray?)(new FlatArray()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int ListLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
|
||||
public static Offset<FlatArrayList> CreateFlatArrayList(FlatBufferBuilder builder,
|
||||
VectorOffset listOffset = default(VectorOffset)) {
|
||||
builder.StartObject(1);
|
||||
FlatArrayList.AddList(builder, listOffset);
|
||||
return FlatArrayList.EndFlatArrayList(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatArrayList(FlatBufferBuilder builder) { builder.StartObject(1); }
|
||||
public static void AddList(FlatBufferBuilder builder, VectorOffset listOffset) { builder.AddOffset(0, listOffset.Value, 0); }
|
||||
public static VectorOffset CreateListVector(FlatBufferBuilder builder, Offset<FlatArray>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateListVectorBlock(FlatBufferBuilder builder, Offset<FlatArray>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartListVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static Offset<FlatArrayList> EndFlatArrayList(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatArrayList>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatArrayList extends Table {
|
||||
public static FlatArrayList getRootAsFlatArrayList(ByteBuffer _bb) { return getRootAsFlatArrayList(_bb, new FlatArrayList()); }
|
||||
public static FlatArrayList getRootAsFlatArrayList(ByteBuffer _bb, FlatArrayList obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatArrayList __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public FlatArray list(int j) { return list(new FlatArray(), j); }
|
||||
public FlatArray list(FlatArray obj, int j) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int listLength() { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; }
|
||||
|
||||
public static int createFlatArrayList(FlatBufferBuilder builder,
|
||||
int listOffset) {
|
||||
builder.startObject(1);
|
||||
FlatArrayList.addList(builder, listOffset);
|
||||
return FlatArrayList.endFlatArrayList(builder);
|
||||
}
|
||||
|
||||
public static void startFlatArrayList(FlatBufferBuilder builder) { builder.startObject(1); }
|
||||
public static void addList(FlatBufferBuilder builder, int listOffset) { builder.addOffset(0, listOffset, 0); }
|
||||
public static int createListVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startListVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static int endFlatArrayList(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatArrayList(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatArrayList(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatArrayList()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatArrayList
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatArrayList
|
||||
def List(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatArray import FlatArray
|
||||
obj = FlatArray()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatArrayList
|
||||
def ListLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
def FlatArrayListStart(builder): builder.StartObject(1)
|
||||
def FlatArrayListAddList(builder, list): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(list), 0)
|
||||
def FlatArrayListStartListVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatArrayListEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,68 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatConfiguration : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatConfiguration GetRootAsFlatConfiguration(ByteBuffer _bb) { return GetRootAsFlatConfiguration(_bb, new FlatConfiguration()); }
|
||||
public static FlatConfiguration GetRootAsFlatConfiguration(ByteBuffer _bb, FlatConfiguration obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatConfiguration __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public ExecutionMode ExecutionMode { get { int o = __p.__offset(6); return o != 0 ? (ExecutionMode)__p.bb.GetSbyte(o + __p.bb_pos) : ExecutionMode.SEQUENTIAL; } }
|
||||
public ProfilingMode ProfilingMode { get { int o = __p.__offset(8); return o != 0 ? (ProfilingMode)__p.bb.GetSbyte(o + __p.bb_pos) : ProfilingMode.NONE; } }
|
||||
public OutputMode OutputMode { get { int o = __p.__offset(10); return o != 0 ? (OutputMode)__p.bb.GetSbyte(o + __p.bb_pos) : OutputMode.IMPLICIT; } }
|
||||
public bool Timestats { get { int o = __p.__offset(12); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
|
||||
public long FootprintForward { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public long FootprintBackward { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public Direction Direction { get { int o = __p.__offset(18); return o != 0 ? (Direction)__p.bb.GetSbyte(o + __p.bb_pos) : Direction.FORWARD_ONLY; } }
|
||||
|
||||
public static Offset<FlatConfiguration> CreateFlatConfiguration(FlatBufferBuilder builder,
|
||||
long id = 0,
|
||||
ExecutionMode executionMode = ExecutionMode.SEQUENTIAL,
|
||||
ProfilingMode profilingMode = ProfilingMode.NONE,
|
||||
OutputMode outputMode = OutputMode.IMPLICIT,
|
||||
bool timestats = false,
|
||||
long footprintForward = 0,
|
||||
long footprintBackward = 0,
|
||||
Direction direction = Direction.FORWARD_ONLY) {
|
||||
builder.StartObject(8);
|
||||
FlatConfiguration.AddFootprintBackward(builder, footprintBackward);
|
||||
FlatConfiguration.AddFootprintForward(builder, footprintForward);
|
||||
FlatConfiguration.AddId(builder, id);
|
||||
FlatConfiguration.AddDirection(builder, direction);
|
||||
FlatConfiguration.AddTimestats(builder, timestats);
|
||||
FlatConfiguration.AddOutputMode(builder, outputMode);
|
||||
FlatConfiguration.AddProfilingMode(builder, profilingMode);
|
||||
FlatConfiguration.AddExecutionMode(builder, executionMode);
|
||||
return FlatConfiguration.EndFlatConfiguration(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatConfiguration(FlatBufferBuilder builder) { builder.StartObject(8); }
|
||||
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
|
||||
public static void AddExecutionMode(FlatBufferBuilder builder, ExecutionMode executionMode) { builder.AddSbyte(1, (sbyte)executionMode, 0); }
|
||||
public static void AddProfilingMode(FlatBufferBuilder builder, ProfilingMode profilingMode) { builder.AddSbyte(2, (sbyte)profilingMode, 0); }
|
||||
public static void AddOutputMode(FlatBufferBuilder builder, OutputMode outputMode) { builder.AddSbyte(3, (sbyte)outputMode, 0); }
|
||||
public static void AddTimestats(FlatBufferBuilder builder, bool timestats) { builder.AddBool(4, timestats, false); }
|
||||
public static void AddFootprintForward(FlatBufferBuilder builder, long footprintForward) { builder.AddLong(5, footprintForward, 0); }
|
||||
public static void AddFootprintBackward(FlatBufferBuilder builder, long footprintBackward) { builder.AddLong(6, footprintBackward, 0); }
|
||||
public static void AddDirection(FlatBufferBuilder builder, Direction direction) { builder.AddSbyte(7, (sbyte)direction, 0); }
|
||||
public static Offset<FlatConfiguration> EndFlatConfiguration(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatConfiguration>(o);
|
||||
}
|
||||
public static void FinishFlatConfigurationBuffer(FlatBufferBuilder builder, Offset<FlatConfiguration> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatConfigurationBuffer(FlatBufferBuilder builder, Offset<FlatConfiguration> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatConfiguration extends Table {
|
||||
public static FlatConfiguration getRootAsFlatConfiguration(ByteBuffer _bb) { return getRootAsFlatConfiguration(_bb, new FlatConfiguration()); }
|
||||
public static FlatConfiguration getRootAsFlatConfiguration(ByteBuffer _bb, FlatConfiguration obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatConfiguration __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long id() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public byte executionMode() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public byte profilingMode() { int o = __offset(8); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public byte outputMode() { int o = __offset(10); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public boolean timestats() { int o = __offset(12); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
|
||||
public long footprintForward() { int o = __offset(14); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public long footprintBackward() { int o = __offset(16); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public byte direction() { int o = __offset(18); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
|
||||
public static int createFlatConfiguration(FlatBufferBuilder builder,
|
||||
long id,
|
||||
byte executionMode,
|
||||
byte profilingMode,
|
||||
byte outputMode,
|
||||
boolean timestats,
|
||||
long footprintForward,
|
||||
long footprintBackward,
|
||||
byte direction) {
|
||||
builder.startObject(8);
|
||||
FlatConfiguration.addFootprintBackward(builder, footprintBackward);
|
||||
FlatConfiguration.addFootprintForward(builder, footprintForward);
|
||||
FlatConfiguration.addId(builder, id);
|
||||
FlatConfiguration.addDirection(builder, direction);
|
||||
FlatConfiguration.addTimestats(builder, timestats);
|
||||
FlatConfiguration.addOutputMode(builder, outputMode);
|
||||
FlatConfiguration.addProfilingMode(builder, profilingMode);
|
||||
FlatConfiguration.addExecutionMode(builder, executionMode);
|
||||
return FlatConfiguration.endFlatConfiguration(builder);
|
||||
}
|
||||
|
||||
public static void startFlatConfiguration(FlatBufferBuilder builder) { builder.startObject(8); }
|
||||
public static void addId(FlatBufferBuilder builder, long id) { builder.addLong(0, id, 0L); }
|
||||
public static void addExecutionMode(FlatBufferBuilder builder, byte executionMode) { builder.addByte(1, executionMode, 0); }
|
||||
public static void addProfilingMode(FlatBufferBuilder builder, byte profilingMode) { builder.addByte(2, profilingMode, 0); }
|
||||
public static void addOutputMode(FlatBufferBuilder builder, byte outputMode) { builder.addByte(3, outputMode, 0); }
|
||||
public static void addTimestats(FlatBufferBuilder builder, boolean timestats) { builder.addBoolean(4, timestats, false); }
|
||||
public static void addFootprintForward(FlatBufferBuilder builder, long footprintForward) { builder.addLong(5, footprintForward, 0L); }
|
||||
public static void addFootprintBackward(FlatBufferBuilder builder, long footprintBackward) { builder.addLong(6, footprintBackward, 0L); }
|
||||
public static void addDirection(FlatBufferBuilder builder, byte direction) { builder.addByte(7, direction, 0); }
|
||||
public static int endFlatConfiguration(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatConfigurationBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatConfigurationBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatConfiguration(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatConfiguration(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatConfiguration()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatConfiguration
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatConfiguration
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatConfiguration
|
||||
def ExecutionMode(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatConfiguration
|
||||
def ProfilingMode(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatConfiguration
|
||||
def OutputMode(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatConfiguration
|
||||
def Timestats(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
|
||||
return False
|
||||
|
||||
# FlatConfiguration
|
||||
def FootprintForward(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatConfiguration
|
||||
def FootprintBackward(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatConfiguration
|
||||
def Direction(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def FlatConfigurationStart(builder): builder.StartObject(8)
|
||||
def FlatConfigurationAddId(builder, id): builder.PrependInt64Slot(0, id, 0)
|
||||
def FlatConfigurationAddExecutionMode(builder, executionMode): builder.PrependInt8Slot(1, executionMode, 0)
|
||||
def FlatConfigurationAddProfilingMode(builder, profilingMode): builder.PrependInt8Slot(2, profilingMode, 0)
|
||||
def FlatConfigurationAddOutputMode(builder, outputMode): builder.PrependInt8Slot(3, outputMode, 0)
|
||||
def FlatConfigurationAddTimestats(builder, timestats): builder.PrependBoolSlot(4, timestats, 0)
|
||||
def FlatConfigurationAddFootprintForward(builder, footprintForward): builder.PrependInt64Slot(5, footprintForward, 0)
|
||||
def FlatConfigurationAddFootprintBackward(builder, footprintBackward): builder.PrependInt64Slot(6, footprintBackward, 0)
|
||||
def FlatConfigurationAddDirection(builder, direction): builder.PrependInt8Slot(7, direction, 0)
|
||||
def FlatConfigurationEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,38 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatDropRequest : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatDropRequest GetRootAsFlatDropRequest(ByteBuffer _bb) { return GetRootAsFlatDropRequest(_bb, new FlatDropRequest()); }
|
||||
public static FlatDropRequest GetRootAsFlatDropRequest(ByteBuffer _bb, FlatDropRequest obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatDropRequest __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
|
||||
public static Offset<FlatDropRequest> CreateFlatDropRequest(FlatBufferBuilder builder,
|
||||
long id = 0) {
|
||||
builder.StartObject(1);
|
||||
FlatDropRequest.AddId(builder, id);
|
||||
return FlatDropRequest.EndFlatDropRequest(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatDropRequest(FlatBufferBuilder builder) { builder.StartObject(1); }
|
||||
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
|
||||
public static Offset<FlatDropRequest> EndFlatDropRequest(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatDropRequest>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatDropRequest extends Table {
|
||||
public static FlatDropRequest getRootAsFlatDropRequest(ByteBuffer _bb) { return getRootAsFlatDropRequest(_bb, new FlatDropRequest()); }
|
||||
public static FlatDropRequest getRootAsFlatDropRequest(ByteBuffer _bb, FlatDropRequest obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatDropRequest __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long id() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
|
||||
public static int createFlatDropRequest(FlatBufferBuilder builder,
|
||||
long id) {
|
||||
builder.startObject(1);
|
||||
FlatDropRequest.addId(builder, id);
|
||||
return FlatDropRequest.endFlatDropRequest(builder);
|
||||
}
|
||||
|
||||
public static void startFlatDropRequest(FlatBufferBuilder builder) { builder.startObject(1); }
|
||||
public static void addId(FlatBufferBuilder builder, long id) { builder.addLong(0, id, 0L); }
|
||||
public static int endFlatDropRequest(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatDropRequest(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatDropRequest(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatDropRequest()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatDropRequest
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatDropRequest
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def FlatDropRequestStart(builder): builder.StartObject(1)
|
||||
def FlatDropRequestAddId(builder, id): builder.PrependInt64Slot(0, id, 0)
|
||||
def FlatDropRequestEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,102 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatGraph : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatGraph GetRootAsFlatGraph(ByteBuffer _bb) { return GetRootAsFlatGraph(_bb, new FlatGraph()); }
|
||||
public static FlatGraph GetRootAsFlatGraph(ByteBuffer _bb, FlatGraph obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatGraph __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public FlatVariable? Variables(int j) { int o = __p.__offset(6); return o != 0 ? (FlatVariable?)(new FlatVariable()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int VariablesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public FlatNode? Nodes(int j) { int o = __p.__offset(8); return o != 0 ? (FlatNode?)(new FlatNode()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int NodesLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public IntPair? Outputs(int j) { int o = __p.__offset(10); return o != 0 ? (IntPair?)(new IntPair()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int OutputsLength { get { int o = __p.__offset(10); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public FlatConfiguration? Configuration { get { int o = __p.__offset(12); return o != 0 ? (FlatConfiguration?)(new FlatConfiguration()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
|
||||
public string Placeholders(int j) { int o = __p.__offset(14); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int PlaceholdersLength { get { int o = __p.__offset(14); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public string LossVariables(int j) { int o = __p.__offset(16); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int LossVariablesLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public string TrainingConfig { get { int o = __p.__offset(18); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetTrainingConfigBytes() { return __p.__vector_as_span(18); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetTrainingConfigBytes() { return __p.__vector_as_arraysegment(18); }
|
||||
#endif
|
||||
public byte[] GetTrainingConfigArray() { return __p.__vector_as_array<byte>(18); }
|
||||
public UpdaterState? UpdaterState(int j) { int o = __p.__offset(20); return o != 0 ? (UpdaterState?)(new UpdaterState()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int UpdaterStateLength { get { int o = __p.__offset(20); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
|
||||
public static Offset<FlatGraph> CreateFlatGraph(FlatBufferBuilder builder,
|
||||
long id = 0,
|
||||
VectorOffset variablesOffset = default(VectorOffset),
|
||||
VectorOffset nodesOffset = default(VectorOffset),
|
||||
VectorOffset outputsOffset = default(VectorOffset),
|
||||
Offset<FlatConfiguration> configurationOffset = default(Offset<FlatConfiguration>),
|
||||
VectorOffset placeholdersOffset = default(VectorOffset),
|
||||
VectorOffset lossVariablesOffset = default(VectorOffset),
|
||||
StringOffset trainingConfigOffset = default(StringOffset),
|
||||
VectorOffset updaterStateOffset = default(VectorOffset)) {
|
||||
builder.StartObject(9);
|
||||
FlatGraph.AddId(builder, id);
|
||||
FlatGraph.AddUpdaterState(builder, updaterStateOffset);
|
||||
FlatGraph.AddTrainingConfig(builder, trainingConfigOffset);
|
||||
FlatGraph.AddLossVariables(builder, lossVariablesOffset);
|
||||
FlatGraph.AddPlaceholders(builder, placeholdersOffset);
|
||||
FlatGraph.AddConfiguration(builder, configurationOffset);
|
||||
FlatGraph.AddOutputs(builder, outputsOffset);
|
||||
FlatGraph.AddNodes(builder, nodesOffset);
|
||||
FlatGraph.AddVariables(builder, variablesOffset);
|
||||
return FlatGraph.EndFlatGraph(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatGraph(FlatBufferBuilder builder) { builder.StartObject(9); }
|
||||
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
|
||||
public static void AddVariables(FlatBufferBuilder builder, VectorOffset variablesOffset) { builder.AddOffset(1, variablesOffset.Value, 0); }
|
||||
public static VectorOffset CreateVariablesVector(FlatBufferBuilder builder, Offset<FlatVariable>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateVariablesVectorBlock(FlatBufferBuilder builder, Offset<FlatVariable>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartVariablesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddNodes(FlatBufferBuilder builder, VectorOffset nodesOffset) { builder.AddOffset(2, nodesOffset.Value, 0); }
|
||||
public static VectorOffset CreateNodesVector(FlatBufferBuilder builder, Offset<FlatNode>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateNodesVectorBlock(FlatBufferBuilder builder, Offset<FlatNode>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartNodesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddOutputs(FlatBufferBuilder builder, VectorOffset outputsOffset) { builder.AddOffset(3, outputsOffset.Value, 0); }
|
||||
public static VectorOffset CreateOutputsVector(FlatBufferBuilder builder, Offset<IntPair>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateOutputsVectorBlock(FlatBufferBuilder builder, Offset<IntPair>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartOutputsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddConfiguration(FlatBufferBuilder builder, Offset<FlatConfiguration> configurationOffset) { builder.AddOffset(4, configurationOffset.Value, 0); }
|
||||
public static void AddPlaceholders(FlatBufferBuilder builder, VectorOffset placeholdersOffset) { builder.AddOffset(5, placeholdersOffset.Value, 0); }
|
||||
public static VectorOffset CreatePlaceholdersVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreatePlaceholdersVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartPlaceholdersVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddLossVariables(FlatBufferBuilder builder, VectorOffset lossVariablesOffset) { builder.AddOffset(6, lossVariablesOffset.Value, 0); }
|
||||
public static VectorOffset CreateLossVariablesVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateLossVariablesVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartLossVariablesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddTrainingConfig(FlatBufferBuilder builder, StringOffset trainingConfigOffset) { builder.AddOffset(7, trainingConfigOffset.Value, 0); }
|
||||
public static void AddUpdaterState(FlatBufferBuilder builder, VectorOffset updaterStateOffset) { builder.AddOffset(8, updaterStateOffset.Value, 0); }
|
||||
public static VectorOffset CreateUpdaterStateVector(FlatBufferBuilder builder, Offset<UpdaterState>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateUpdaterStateVectorBlock(FlatBufferBuilder builder, Offset<UpdaterState>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartUpdaterStateVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static Offset<FlatGraph> EndFlatGraph(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatGraph>(o);
|
||||
}
|
||||
public static void FinishFlatGraphBuffer(FlatBufferBuilder builder, Offset<FlatGraph> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatGraphBuffer(FlatBufferBuilder builder, Offset<FlatGraph> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatGraph extends Table {
|
||||
public static FlatGraph getRootAsFlatGraph(ByteBuffer _bb) { return getRootAsFlatGraph(_bb, new FlatGraph()); }
|
||||
public static FlatGraph getRootAsFlatGraph(ByteBuffer _bb, FlatGraph obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatGraph __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long id() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public FlatVariable variables(int j) { return variables(new FlatVariable(), j); }
|
||||
public FlatVariable variables(FlatVariable obj, int j) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int variablesLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
|
||||
public FlatNode nodes(int j) { return nodes(new FlatNode(), j); }
|
||||
public FlatNode nodes(FlatNode obj, int j) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int nodesLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }
|
||||
public IntPair outputs(int j) { return outputs(new IntPair(), j); }
|
||||
public IntPair outputs(IntPair obj, int j) { int o = __offset(10); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int outputsLength() { int o = __offset(10); return o != 0 ? __vector_len(o) : 0; }
|
||||
public FlatConfiguration configuration() { return configuration(new FlatConfiguration()); }
|
||||
public FlatConfiguration configuration(FlatConfiguration obj) { int o = __offset(12); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public String placeholders(int j) { int o = __offset(14); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int placeholdersLength() { int o = __offset(14); return o != 0 ? __vector_len(o) : 0; }
|
||||
public String lossVariables(int j) { int o = __offset(16); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int lossVariablesLength() { int o = __offset(16); return o != 0 ? __vector_len(o) : 0; }
|
||||
public String trainingConfig() { int o = __offset(18); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer trainingConfigAsByteBuffer() { return __vector_as_bytebuffer(18, 1); }
|
||||
public ByteBuffer trainingConfigInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 18, 1); }
|
||||
public UpdaterState updaterState(int j) { return updaterState(new UpdaterState(), j); }
|
||||
public UpdaterState updaterState(UpdaterState obj, int j) { int o = __offset(20); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int updaterStateLength() { int o = __offset(20); return o != 0 ? __vector_len(o) : 0; }
|
||||
|
||||
public static int createFlatGraph(FlatBufferBuilder builder,
|
||||
long id,
|
||||
int variablesOffset,
|
||||
int nodesOffset,
|
||||
int outputsOffset,
|
||||
int configurationOffset,
|
||||
int placeholdersOffset,
|
||||
int lossVariablesOffset,
|
||||
int trainingConfigOffset,
|
||||
int updaterStateOffset) {
|
||||
builder.startObject(9);
|
||||
FlatGraph.addId(builder, id);
|
||||
FlatGraph.addUpdaterState(builder, updaterStateOffset);
|
||||
FlatGraph.addTrainingConfig(builder, trainingConfigOffset);
|
||||
FlatGraph.addLossVariables(builder, lossVariablesOffset);
|
||||
FlatGraph.addPlaceholders(builder, placeholdersOffset);
|
||||
FlatGraph.addConfiguration(builder, configurationOffset);
|
||||
FlatGraph.addOutputs(builder, outputsOffset);
|
||||
FlatGraph.addNodes(builder, nodesOffset);
|
||||
FlatGraph.addVariables(builder, variablesOffset);
|
||||
return FlatGraph.endFlatGraph(builder);
|
||||
}
|
||||
|
||||
public static void startFlatGraph(FlatBufferBuilder builder) { builder.startObject(9); }
|
||||
public static void addId(FlatBufferBuilder builder, long id) { builder.addLong(0, id, 0L); }
|
||||
public static void addVariables(FlatBufferBuilder builder, int variablesOffset) { builder.addOffset(1, variablesOffset, 0); }
|
||||
public static int createVariablesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startVariablesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addNodes(FlatBufferBuilder builder, int nodesOffset) { builder.addOffset(2, nodesOffset, 0); }
|
||||
public static int createNodesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startNodesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addOutputs(FlatBufferBuilder builder, int outputsOffset) { builder.addOffset(3, outputsOffset, 0); }
|
||||
public static int createOutputsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startOutputsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addConfiguration(FlatBufferBuilder builder, int configurationOffset) { builder.addOffset(4, configurationOffset, 0); }
|
||||
public static void addPlaceholders(FlatBufferBuilder builder, int placeholdersOffset) { builder.addOffset(5, placeholdersOffset, 0); }
|
||||
public static int createPlaceholdersVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startPlaceholdersVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addLossVariables(FlatBufferBuilder builder, int lossVariablesOffset) { builder.addOffset(6, lossVariablesOffset, 0); }
|
||||
public static int createLossVariablesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startLossVariablesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addTrainingConfig(FlatBufferBuilder builder, int trainingConfigOffset) { builder.addOffset(7, trainingConfigOffset, 0); }
|
||||
public static void addUpdaterState(FlatBufferBuilder builder, int updaterStateOffset) { builder.addOffset(8, updaterStateOffset, 0); }
|
||||
public static int createUpdaterStateVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startUpdaterStateVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static int endFlatGraph(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatGraphBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatGraphBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatGraph(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatGraph(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatGraph()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatGraph
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatGraph
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatGraph
|
||||
def Variables(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatVariable import FlatVariable
|
||||
obj = FlatVariable()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatGraph
|
||||
def VariablesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatGraph
|
||||
def Nodes(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatNode import FlatNode
|
||||
obj = FlatNode()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatGraph
|
||||
def NodesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatGraph
|
||||
def Outputs(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .IntPair import IntPair
|
||||
obj = IntPair()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatGraph
|
||||
def OutputsLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatGraph
|
||||
def Configuration(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .FlatConfiguration import FlatConfiguration
|
||||
obj = FlatConfiguration()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatGraph
|
||||
def Placeholders(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatGraph
|
||||
def PlaceholdersLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatGraph
|
||||
def LossVariables(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatGraph
|
||||
def LossVariablesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatGraph
|
||||
def TrainingConfig(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FlatGraph
|
||||
def UpdaterState(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .UpdaterState import UpdaterState
|
||||
obj = UpdaterState()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatGraph
|
||||
def UpdaterStateLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
def FlatGraphStart(builder): builder.StartObject(9)
|
||||
def FlatGraphAddId(builder, id): builder.PrependInt64Slot(0, id, 0)
|
||||
def FlatGraphAddVariables(builder, variables): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(variables), 0)
|
||||
def FlatGraphStartVariablesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatGraphAddNodes(builder, nodes): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(nodes), 0)
|
||||
def FlatGraphStartNodesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatGraphAddOutputs(builder, outputs): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(outputs), 0)
|
||||
def FlatGraphStartOutputsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatGraphAddConfiguration(builder, configuration): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(configuration), 0)
|
||||
def FlatGraphAddPlaceholders(builder, placeholders): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(placeholders), 0)
|
||||
def FlatGraphStartPlaceholdersVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatGraphAddLossVariables(builder, lossVariables): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(lossVariables), 0)
|
||||
def FlatGraphStartLossVariablesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatGraphAddTrainingConfig(builder, trainingConfig): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(trainingConfig), 0)
|
||||
def FlatGraphAddUpdaterState(builder, updaterState): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(updaterState), 0)
|
||||
def FlatGraphStartUpdaterStateVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatGraphEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,52 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatInferenceRequest : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatInferenceRequest GetRootAsFlatInferenceRequest(ByteBuffer _bb) { return GetRootAsFlatInferenceRequest(_bb, new FlatInferenceRequest()); }
|
||||
public static FlatInferenceRequest GetRootAsFlatInferenceRequest(ByteBuffer _bb, FlatInferenceRequest obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatInferenceRequest __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public FlatVariable? Variables(int j) { int o = __p.__offset(6); return o != 0 ? (FlatVariable?)(new FlatVariable()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int VariablesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public FlatConfiguration? Configuration { get { int o = __p.__offset(8); return o != 0 ? (FlatConfiguration?)(new FlatConfiguration()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
|
||||
|
||||
public static Offset<FlatInferenceRequest> CreateFlatInferenceRequest(FlatBufferBuilder builder,
|
||||
long id = 0,
|
||||
VectorOffset variablesOffset = default(VectorOffset),
|
||||
Offset<FlatConfiguration> configurationOffset = default(Offset<FlatConfiguration>)) {
|
||||
builder.StartObject(3);
|
||||
FlatInferenceRequest.AddId(builder, id);
|
||||
FlatInferenceRequest.AddConfiguration(builder, configurationOffset);
|
||||
FlatInferenceRequest.AddVariables(builder, variablesOffset);
|
||||
return FlatInferenceRequest.EndFlatInferenceRequest(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatInferenceRequest(FlatBufferBuilder builder) { builder.StartObject(3); }
|
||||
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
|
||||
public static void AddVariables(FlatBufferBuilder builder, VectorOffset variablesOffset) { builder.AddOffset(1, variablesOffset.Value, 0); }
|
||||
public static VectorOffset CreateVariablesVector(FlatBufferBuilder builder, Offset<FlatVariable>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateVariablesVectorBlock(FlatBufferBuilder builder, Offset<FlatVariable>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartVariablesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddConfiguration(FlatBufferBuilder builder, Offset<FlatConfiguration> configurationOffset) { builder.AddOffset(2, configurationOffset.Value, 0); }
|
||||
public static Offset<FlatInferenceRequest> EndFlatInferenceRequest(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatInferenceRequest>(o);
|
||||
}
|
||||
public static void FinishFlatInferenceRequestBuffer(FlatBufferBuilder builder, Offset<FlatInferenceRequest> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatInferenceRequestBuffer(FlatBufferBuilder builder, Offset<FlatInferenceRequest> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatInferenceRequest extends Table {
|
||||
public static FlatInferenceRequest getRootAsFlatInferenceRequest(ByteBuffer _bb) { return getRootAsFlatInferenceRequest(_bb, new FlatInferenceRequest()); }
|
||||
public static FlatInferenceRequest getRootAsFlatInferenceRequest(ByteBuffer _bb, FlatInferenceRequest obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatInferenceRequest __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long id() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public FlatVariable variables(int j) { return variables(new FlatVariable(), j); }
|
||||
public FlatVariable variables(FlatVariable obj, int j) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int variablesLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
|
||||
public FlatConfiguration configuration() { return configuration(new FlatConfiguration()); }
|
||||
public FlatConfiguration configuration(FlatConfiguration obj) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
|
||||
public static int createFlatInferenceRequest(FlatBufferBuilder builder,
|
||||
long id,
|
||||
int variablesOffset,
|
||||
int configurationOffset) {
|
||||
builder.startObject(3);
|
||||
FlatInferenceRequest.addId(builder, id);
|
||||
FlatInferenceRequest.addConfiguration(builder, configurationOffset);
|
||||
FlatInferenceRequest.addVariables(builder, variablesOffset);
|
||||
return FlatInferenceRequest.endFlatInferenceRequest(builder);
|
||||
}
|
||||
|
||||
public static void startFlatInferenceRequest(FlatBufferBuilder builder) { builder.startObject(3); }
|
||||
public static void addId(FlatBufferBuilder builder, long id) { builder.addLong(0, id, 0L); }
|
||||
public static void addVariables(FlatBufferBuilder builder, int variablesOffset) { builder.addOffset(1, variablesOffset, 0); }
|
||||
public static int createVariablesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startVariablesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addConfiguration(FlatBufferBuilder builder, int configurationOffset) { builder.addOffset(2, configurationOffset, 0); }
|
||||
public static int endFlatInferenceRequest(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatInferenceRequestBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatInferenceRequestBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatInferenceRequest(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatInferenceRequest(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatInferenceRequest()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatInferenceRequest
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatInferenceRequest
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatInferenceRequest
|
||||
def Variables(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatVariable import FlatVariable
|
||||
obj = FlatVariable()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatInferenceRequest
|
||||
def VariablesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatInferenceRequest
|
||||
def Configuration(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .FlatConfiguration import FlatConfiguration
|
||||
obj = FlatConfiguration()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
def FlatInferenceRequestStart(builder): builder.StartObject(3)
|
||||
def FlatInferenceRequestAddId(builder, id): builder.PrependInt64Slot(0, id, 0)
|
||||
def FlatInferenceRequestAddVariables(builder, variables): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(variables), 0)
|
||||
def FlatInferenceRequestStartVariablesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatInferenceRequestAddConfiguration(builder, configuration): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(configuration), 0)
|
||||
def FlatInferenceRequestEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,250 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatNode : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatNode GetRootAsFlatNode(ByteBuffer _bb) { return GetRootAsFlatNode(_bb, new FlatNode()); }
|
||||
public static FlatNode GetRootAsFlatNode(ByteBuffer _bb, FlatNode obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatNode __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public string Name { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetNameBytes() { return __p.__vector_as_span(6); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetNameBytes() { return __p.__vector_as_arraysegment(6); }
|
||||
#endif
|
||||
public byte[] GetNameArray() { return __p.__vector_as_array<byte>(6); }
|
||||
public OpType OpType { get { int o = __p.__offset(8); return o != 0 ? (OpType)__p.bb.GetSbyte(o + __p.bb_pos) : OpType.TRANSFORM_FLOAT; } }
|
||||
public long OpNum { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public FlatProperties? Properties(int j) { int o = __p.__offset(12); return o != 0 ? (FlatProperties?)(new FlatProperties()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int PropertiesLength { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public int Input(int j) { int o = __p.__offset(14); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int)0; }
|
||||
public int InputLength { get { int o = __p.__offset(14); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetInputBytes() { return __p.__vector_as_span(14); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetInputBytes() { return __p.__vector_as_arraysegment(14); }
|
||||
#endif
|
||||
public int[] GetInputArray() { return __p.__vector_as_array<int>(14); }
|
||||
public IntPair? InputPaired(int j) { int o = __p.__offset(16); return o != 0 ? (IntPair?)(new IntPair()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int InputPairedLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public int Output(int j) { int o = __p.__offset(18); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int)0; }
|
||||
public int OutputLength { get { int o = __p.__offset(18); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetOutputBytes() { return __p.__vector_as_span(18); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetOutputBytes() { return __p.__vector_as_arraysegment(18); }
|
||||
#endif
|
||||
public int[] GetOutputArray() { return __p.__vector_as_array<int>(18); }
|
||||
public double ExtraParams(int j) { int o = __p.__offset(20); return o != 0 ? __p.bb.GetDouble(__p.__vector(o) + j * 8) : (double)0; }
|
||||
public int ExtraParamsLength { get { int o = __p.__offset(20); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetExtraParamsBytes() { return __p.__vector_as_span(20); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetExtraParamsBytes() { return __p.__vector_as_arraysegment(20); }
|
||||
#endif
|
||||
public double[] GetExtraParamsArray() { return __p.__vector_as_array<double>(20); }
|
||||
public long ExtraInteger(int j) { int o = __p.__offset(22); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
|
||||
public int ExtraIntegerLength { get { int o = __p.__offset(22); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetExtraIntegerBytes() { return __p.__vector_as_span(22); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetExtraIntegerBytes() { return __p.__vector_as_arraysegment(22); }
|
||||
#endif
|
||||
public long[] GetExtraIntegerArray() { return __p.__vector_as_array<long>(22); }
|
||||
public bool ExtraBools(int j) { int o = __p.__offset(24); return o != 0 ? 0!=__p.bb.Get(__p.__vector(o) + j * 1) : false; }
|
||||
public int ExtraBoolsLength { get { int o = __p.__offset(24); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetExtraBoolsBytes() { return __p.__vector_as_span(24); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetExtraBoolsBytes() { return __p.__vector_as_arraysegment(24); }
|
||||
#endif
|
||||
public bool[] GetExtraBoolsArray() { return __p.__vector_as_array<bool>(24); }
|
||||
public int Dimensions(int j) { int o = __p.__offset(26); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int)0; }
|
||||
public int DimensionsLength { get { int o = __p.__offset(26); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetDimensionsBytes() { return __p.__vector_as_span(26); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetDimensionsBytes() { return __p.__vector_as_arraysegment(26); }
|
||||
#endif
|
||||
public int[] GetDimensionsArray() { return __p.__vector_as_array<int>(26); }
|
||||
public int Device { get { int o = __p.__offset(28); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public int ScopeId { get { int o = __p.__offset(30); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public string ScopeName { get { int o = __p.__offset(32); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetScopeNameBytes() { return __p.__vector_as_span(32); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetScopeNameBytes() { return __p.__vector_as_arraysegment(32); }
|
||||
#endif
|
||||
public byte[] GetScopeNameArray() { return __p.__vector_as_array<byte>(32); }
|
||||
public string OutputNames(int j) { int o = __p.__offset(34); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int OutputNamesLength { get { int o = __p.__offset(34); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public string OpName { get { int o = __p.__offset(36); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetOpNameBytes() { return __p.__vector_as_span(36); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetOpNameBytes() { return __p.__vector_as_arraysegment(36); }
|
||||
#endif
|
||||
public byte[] GetOpNameArray() { return __p.__vector_as_array<byte>(36); }
|
||||
public DType OutputTypes(int j) { int o = __p.__offset(38); return o != 0 ? (DType)__p.bb.GetSbyte(__p.__vector(o) + j * 1) : (DType)0; }
|
||||
public int OutputTypesLength { get { int o = __p.__offset(38); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetOutputTypesBytes() { return __p.__vector_as_span(38); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetOutputTypesBytes() { return __p.__vector_as_arraysegment(38); }
|
||||
#endif
|
||||
public DType[] GetOutputTypesArray() { return __p.__vector_as_array<DType>(38); }
|
||||
public FlatArray? Scalar { get { int o = __p.__offset(40); return o != 0 ? (FlatArray?)(new FlatArray()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
|
||||
public string ControlDeps(int j) { int o = __p.__offset(42); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int ControlDepsLength { get { int o = __p.__offset(42); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public string VarControlDeps(int j) { int o = __p.__offset(44); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int VarControlDepsLength { get { int o = __p.__offset(44); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public string ControlDepFor(int j) { int o = __p.__offset(46); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int ControlDepForLength { get { int o = __p.__offset(46); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public DType ExtraTypes(int j) { int o = __p.__offset(48); return o != 0 ? (DType)__p.bb.GetSbyte(__p.__vector(o) + j * 1) : (DType)0; }
|
||||
public int ExtraTypesLength { get { int o = __p.__offset(48); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetExtraTypesBytes() { return __p.__vector_as_span(48); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetExtraTypesBytes() { return __p.__vector_as_arraysegment(48); }
|
||||
#endif
|
||||
public DType[] GetExtraTypesArray() { return __p.__vector_as_array<DType>(48); }
|
||||
|
||||
public static Offset<FlatNode> CreateFlatNode(FlatBufferBuilder builder,
|
||||
int id = 0,
|
||||
StringOffset nameOffset = default(StringOffset),
|
||||
OpType opType = OpType.TRANSFORM_FLOAT,
|
||||
long opNum = 0,
|
||||
VectorOffset propertiesOffset = default(VectorOffset),
|
||||
VectorOffset inputOffset = default(VectorOffset),
|
||||
VectorOffset inputPairedOffset = default(VectorOffset),
|
||||
VectorOffset outputOffset = default(VectorOffset),
|
||||
VectorOffset extraParamsOffset = default(VectorOffset),
|
||||
VectorOffset extraIntegerOffset = default(VectorOffset),
|
||||
VectorOffset extraBoolsOffset = default(VectorOffset),
|
||||
VectorOffset dimensionsOffset = default(VectorOffset),
|
||||
int device = 0,
|
||||
int scope_id = 0,
|
||||
StringOffset scope_nameOffset = default(StringOffset),
|
||||
VectorOffset outputNamesOffset = default(VectorOffset),
|
||||
StringOffset opNameOffset = default(StringOffset),
|
||||
VectorOffset outputTypesOffset = default(VectorOffset),
|
||||
Offset<FlatArray> scalarOffset = default(Offset<FlatArray>),
|
||||
VectorOffset controlDepsOffset = default(VectorOffset),
|
||||
VectorOffset varControlDepsOffset = default(VectorOffset),
|
||||
VectorOffset controlDepForOffset = default(VectorOffset),
|
||||
VectorOffset extraTypesOffset = default(VectorOffset)) {
|
||||
builder.StartObject(23);
|
||||
FlatNode.AddOpNum(builder, opNum);
|
||||
FlatNode.AddExtraTypes(builder, extraTypesOffset);
|
||||
FlatNode.AddControlDepFor(builder, controlDepForOffset);
|
||||
FlatNode.AddVarControlDeps(builder, varControlDepsOffset);
|
||||
FlatNode.AddControlDeps(builder, controlDepsOffset);
|
||||
FlatNode.AddScalar(builder, scalarOffset);
|
||||
FlatNode.AddOutputTypes(builder, outputTypesOffset);
|
||||
FlatNode.AddOpName(builder, opNameOffset);
|
||||
FlatNode.AddOutputNames(builder, outputNamesOffset);
|
||||
FlatNode.AddScopeName(builder, scope_nameOffset);
|
||||
FlatNode.AddScopeId(builder, scope_id);
|
||||
FlatNode.AddDevice(builder, device);
|
||||
FlatNode.AddDimensions(builder, dimensionsOffset);
|
||||
FlatNode.AddExtraBools(builder, extraBoolsOffset);
|
||||
FlatNode.AddExtraInteger(builder, extraIntegerOffset);
|
||||
FlatNode.AddExtraParams(builder, extraParamsOffset);
|
||||
FlatNode.AddOutput(builder, outputOffset);
|
||||
FlatNode.AddInputPaired(builder, inputPairedOffset);
|
||||
FlatNode.AddInput(builder, inputOffset);
|
||||
FlatNode.AddProperties(builder, propertiesOffset);
|
||||
FlatNode.AddName(builder, nameOffset);
|
||||
FlatNode.AddId(builder, id);
|
||||
FlatNode.AddOpType(builder, opType);
|
||||
return FlatNode.EndFlatNode(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatNode(FlatBufferBuilder builder) { builder.StartObject(23); }
|
||||
public static void AddId(FlatBufferBuilder builder, int id) { builder.AddInt(0, id, 0); }
|
||||
public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(1, nameOffset.Value, 0); }
|
||||
public static void AddOpType(FlatBufferBuilder builder, OpType opType) { builder.AddSbyte(2, (sbyte)opType, 0); }
|
||||
public static void AddOpNum(FlatBufferBuilder builder, long opNum) { builder.AddLong(3, opNum, 0); }
|
||||
public static void AddProperties(FlatBufferBuilder builder, VectorOffset propertiesOffset) { builder.AddOffset(4, propertiesOffset.Value, 0); }
|
||||
public static VectorOffset CreatePropertiesVector(FlatBufferBuilder builder, Offset<FlatProperties>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreatePropertiesVectorBlock(FlatBufferBuilder builder, Offset<FlatProperties>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartPropertiesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddInput(FlatBufferBuilder builder, VectorOffset inputOffset) { builder.AddOffset(5, inputOffset.Value, 0); }
|
||||
public static VectorOffset CreateInputVector(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateInputVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartInputVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddInputPaired(FlatBufferBuilder builder, VectorOffset inputPairedOffset) { builder.AddOffset(6, inputPairedOffset.Value, 0); }
|
||||
public static VectorOffset CreateInputPairedVector(FlatBufferBuilder builder, Offset<IntPair>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateInputPairedVectorBlock(FlatBufferBuilder builder, Offset<IntPair>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartInputPairedVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddOutput(FlatBufferBuilder builder, VectorOffset outputOffset) { builder.AddOffset(7, outputOffset.Value, 0); }
|
||||
public static VectorOffset CreateOutputVector(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateOutputVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartOutputVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddExtraParams(FlatBufferBuilder builder, VectorOffset extraParamsOffset) { builder.AddOffset(8, extraParamsOffset.Value, 0); }
|
||||
public static VectorOffset CreateExtraParamsVector(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddDouble(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateExtraParamsVectorBlock(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartExtraParamsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
|
||||
public static void AddExtraInteger(FlatBufferBuilder builder, VectorOffset extraIntegerOffset) { builder.AddOffset(9, extraIntegerOffset.Value, 0); }
|
||||
public static VectorOffset CreateExtraIntegerVector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateExtraIntegerVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartExtraIntegerVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
|
||||
public static void AddExtraBools(FlatBufferBuilder builder, VectorOffset extraBoolsOffset) { builder.AddOffset(10, extraBoolsOffset.Value, 0); }
|
||||
public static VectorOffset CreateExtraBoolsVector(FlatBufferBuilder builder, bool[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddBool(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateExtraBoolsVectorBlock(FlatBufferBuilder builder, bool[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartExtraBoolsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
|
||||
public static void AddDimensions(FlatBufferBuilder builder, VectorOffset dimensionsOffset) { builder.AddOffset(11, dimensionsOffset.Value, 0); }
|
||||
public static VectorOffset CreateDimensionsVector(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateDimensionsVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartDimensionsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddDevice(FlatBufferBuilder builder, int device) { builder.AddInt(12, device, 0); }
|
||||
public static void AddScopeId(FlatBufferBuilder builder, int scopeId) { builder.AddInt(13, scopeId, 0); }
|
||||
public static void AddScopeName(FlatBufferBuilder builder, StringOffset scopeNameOffset) { builder.AddOffset(14, scopeNameOffset.Value, 0); }
|
||||
public static void AddOutputNames(FlatBufferBuilder builder, VectorOffset outputNamesOffset) { builder.AddOffset(15, outputNamesOffset.Value, 0); }
|
||||
public static VectorOffset CreateOutputNamesVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateOutputNamesVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartOutputNamesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddOpName(FlatBufferBuilder builder, StringOffset opNameOffset) { builder.AddOffset(16, opNameOffset.Value, 0); }
|
||||
public static void AddOutputTypes(FlatBufferBuilder builder, VectorOffset outputTypesOffset) { builder.AddOffset(17, outputTypesOffset.Value, 0); }
|
||||
public static VectorOffset CreateOutputTypesVector(FlatBufferBuilder builder, DType[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddSbyte((sbyte)data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateOutputTypesVectorBlock(FlatBufferBuilder builder, DType[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartOutputTypesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
|
||||
public static void AddScalar(FlatBufferBuilder builder, Offset<FlatArray> scalarOffset) { builder.AddOffset(18, scalarOffset.Value, 0); }
|
||||
public static void AddControlDeps(FlatBufferBuilder builder, VectorOffset controlDepsOffset) { builder.AddOffset(19, controlDepsOffset.Value, 0); }
|
||||
public static VectorOffset CreateControlDepsVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateControlDepsVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartControlDepsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddVarControlDeps(FlatBufferBuilder builder, VectorOffset varControlDepsOffset) { builder.AddOffset(20, varControlDepsOffset.Value, 0); }
|
||||
public static VectorOffset CreateVarControlDepsVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateVarControlDepsVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartVarControlDepsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddControlDepFor(FlatBufferBuilder builder, VectorOffset controlDepForOffset) { builder.AddOffset(21, controlDepForOffset.Value, 0); }
|
||||
public static VectorOffset CreateControlDepForVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateControlDepForVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartControlDepForVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddExtraTypes(FlatBufferBuilder builder, VectorOffset extraTypesOffset) { builder.AddOffset(22, extraTypesOffset.Value, 0); }
|
||||
public static VectorOffset CreateExtraTypesVector(FlatBufferBuilder builder, DType[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddSbyte((sbyte)data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateExtraTypesVectorBlock(FlatBufferBuilder builder, DType[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartExtraTypesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
|
||||
public static Offset<FlatNode> EndFlatNode(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatNode>(o);
|
||||
}
|
||||
public static void FinishFlatNodeBuffer(FlatBufferBuilder builder, Offset<FlatNode> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatNodeBuffer(FlatBufferBuilder builder, Offset<FlatNode> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,190 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatNode extends Table {
|
||||
public static FlatNode getRootAsFlatNode(ByteBuffer _bb) { return getRootAsFlatNode(_bb, new FlatNode()); }
|
||||
public static FlatNode getRootAsFlatNode(ByteBuffer _bb, FlatNode obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatNode __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int id() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
|
||||
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
|
||||
public byte opType() { int o = __offset(8); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public long opNum() { int o = __offset(10); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public FlatProperties properties(int j) { return properties(new FlatProperties(), j); }
|
||||
public FlatProperties properties(FlatProperties obj, int j) { int o = __offset(12); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int propertiesLength() { int o = __offset(12); return o != 0 ? __vector_len(o) : 0; }
|
||||
public int input(int j) { int o = __offset(14); return o != 0 ? bb.getInt(__vector(o) + j * 4) : 0; }
|
||||
public int inputLength() { int o = __offset(14); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer inputAsByteBuffer() { return __vector_as_bytebuffer(14, 4); }
|
||||
public ByteBuffer inputInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 14, 4); }
|
||||
public IntPair inputPaired(int j) { return inputPaired(new IntPair(), j); }
|
||||
public IntPair inputPaired(IntPair obj, int j) { int o = __offset(16); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int inputPairedLength() { int o = __offset(16); return o != 0 ? __vector_len(o) : 0; }
|
||||
public int output(int j) { int o = __offset(18); return o != 0 ? bb.getInt(__vector(o) + j * 4) : 0; }
|
||||
public int outputLength() { int o = __offset(18); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer outputAsByteBuffer() { return __vector_as_bytebuffer(18, 4); }
|
||||
public ByteBuffer outputInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 18, 4); }
|
||||
public double extraParams(int j) { int o = __offset(20); return o != 0 ? bb.getDouble(__vector(o) + j * 8) : 0; }
|
||||
public int extraParamsLength() { int o = __offset(20); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer extraParamsAsByteBuffer() { return __vector_as_bytebuffer(20, 8); }
|
||||
public ByteBuffer extraParamsInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 20, 8); }
|
||||
public long extraInteger(int j) { int o = __offset(22); return o != 0 ? bb.getLong(__vector(o) + j * 8) : 0; }
|
||||
public int extraIntegerLength() { int o = __offset(22); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer extraIntegerAsByteBuffer() { return __vector_as_bytebuffer(22, 8); }
|
||||
public ByteBuffer extraIntegerInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 22, 8); }
|
||||
public boolean extraBools(int j) { int o = __offset(24); return o != 0 ? 0!=bb.get(__vector(o) + j * 1) : false; }
|
||||
public int extraBoolsLength() { int o = __offset(24); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer extraBoolsAsByteBuffer() { return __vector_as_bytebuffer(24, 1); }
|
||||
public ByteBuffer extraBoolsInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 24, 1); }
|
||||
public int dimensions(int j) { int o = __offset(26); return o != 0 ? bb.getInt(__vector(o) + j * 4) : 0; }
|
||||
public int dimensionsLength() { int o = __offset(26); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer dimensionsAsByteBuffer() { return __vector_as_bytebuffer(26, 4); }
|
||||
public ByteBuffer dimensionsInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 26, 4); }
|
||||
public int device() { int o = __offset(28); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public int scopeId() { int o = __offset(30); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public String scopeName() { int o = __offset(32); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer scopeNameAsByteBuffer() { return __vector_as_bytebuffer(32, 1); }
|
||||
public ByteBuffer scopeNameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 32, 1); }
|
||||
public String outputNames(int j) { int o = __offset(34); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int outputNamesLength() { int o = __offset(34); return o != 0 ? __vector_len(o) : 0; }
|
||||
public String opName() { int o = __offset(36); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer opNameAsByteBuffer() { return __vector_as_bytebuffer(36, 1); }
|
||||
public ByteBuffer opNameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 36, 1); }
|
||||
public byte outputTypes(int j) { int o = __offset(38); return o != 0 ? bb.get(__vector(o) + j * 1) : 0; }
|
||||
public int outputTypesLength() { int o = __offset(38); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer outputTypesAsByteBuffer() { return __vector_as_bytebuffer(38, 1); }
|
||||
public ByteBuffer outputTypesInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 38, 1); }
|
||||
public FlatArray scalar() { return scalar(new FlatArray()); }
|
||||
public FlatArray scalar(FlatArray obj) { int o = __offset(40); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public String controlDeps(int j) { int o = __offset(42); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int controlDepsLength() { int o = __offset(42); return o != 0 ? __vector_len(o) : 0; }
|
||||
public String varControlDeps(int j) { int o = __offset(44); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int varControlDepsLength() { int o = __offset(44); return o != 0 ? __vector_len(o) : 0; }
|
||||
public String controlDepFor(int j) { int o = __offset(46); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int controlDepForLength() { int o = __offset(46); return o != 0 ? __vector_len(o) : 0; }
|
||||
public byte extraTypes(int j) { int o = __offset(48); return o != 0 ? bb.get(__vector(o) + j * 1) : 0; }
|
||||
public int extraTypesLength() { int o = __offset(48); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer extraTypesAsByteBuffer() { return __vector_as_bytebuffer(48, 1); }
|
||||
public ByteBuffer extraTypesInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 48, 1); }
|
||||
|
||||
public static int createFlatNode(FlatBufferBuilder builder,
|
||||
int id,
|
||||
int nameOffset,
|
||||
byte opType,
|
||||
long opNum,
|
||||
int propertiesOffset,
|
||||
int inputOffset,
|
||||
int inputPairedOffset,
|
||||
int outputOffset,
|
||||
int extraParamsOffset,
|
||||
int extraIntegerOffset,
|
||||
int extraBoolsOffset,
|
||||
int dimensionsOffset,
|
||||
int device,
|
||||
int scope_id,
|
||||
int scope_nameOffset,
|
||||
int outputNamesOffset,
|
||||
int opNameOffset,
|
||||
int outputTypesOffset,
|
||||
int scalarOffset,
|
||||
int controlDepsOffset,
|
||||
int varControlDepsOffset,
|
||||
int controlDepForOffset,
|
||||
int extraTypesOffset) {
|
||||
builder.startObject(23);
|
||||
FlatNode.addOpNum(builder, opNum);
|
||||
FlatNode.addExtraTypes(builder, extraTypesOffset);
|
||||
FlatNode.addControlDepFor(builder, controlDepForOffset);
|
||||
FlatNode.addVarControlDeps(builder, varControlDepsOffset);
|
||||
FlatNode.addControlDeps(builder, controlDepsOffset);
|
||||
FlatNode.addScalar(builder, scalarOffset);
|
||||
FlatNode.addOutputTypes(builder, outputTypesOffset);
|
||||
FlatNode.addOpName(builder, opNameOffset);
|
||||
FlatNode.addOutputNames(builder, outputNamesOffset);
|
||||
FlatNode.addScopeName(builder, scope_nameOffset);
|
||||
FlatNode.addScopeId(builder, scope_id);
|
||||
FlatNode.addDevice(builder, device);
|
||||
FlatNode.addDimensions(builder, dimensionsOffset);
|
||||
FlatNode.addExtraBools(builder, extraBoolsOffset);
|
||||
FlatNode.addExtraInteger(builder, extraIntegerOffset);
|
||||
FlatNode.addExtraParams(builder, extraParamsOffset);
|
||||
FlatNode.addOutput(builder, outputOffset);
|
||||
FlatNode.addInputPaired(builder, inputPairedOffset);
|
||||
FlatNode.addInput(builder, inputOffset);
|
||||
FlatNode.addProperties(builder, propertiesOffset);
|
||||
FlatNode.addName(builder, nameOffset);
|
||||
FlatNode.addId(builder, id);
|
||||
FlatNode.addOpType(builder, opType);
|
||||
return FlatNode.endFlatNode(builder);
|
||||
}
|
||||
|
||||
public static void startFlatNode(FlatBufferBuilder builder) { builder.startObject(23); }
|
||||
public static void addId(FlatBufferBuilder builder, int id) { builder.addInt(0, id, 0); }
|
||||
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
|
||||
public static void addOpType(FlatBufferBuilder builder, byte opType) { builder.addByte(2, opType, 0); }
|
||||
public static void addOpNum(FlatBufferBuilder builder, long opNum) { builder.addLong(3, opNum, 0L); }
|
||||
public static void addProperties(FlatBufferBuilder builder, int propertiesOffset) { builder.addOffset(4, propertiesOffset, 0); }
|
||||
public static int createPropertiesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startPropertiesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addInput(FlatBufferBuilder builder, int inputOffset) { builder.addOffset(5, inputOffset, 0); }
|
||||
public static int createInputVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addInt(data[i]); return builder.endVector(); }
|
||||
public static void startInputVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addInputPaired(FlatBufferBuilder builder, int inputPairedOffset) { builder.addOffset(6, inputPairedOffset, 0); }
|
||||
public static int createInputPairedVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startInputPairedVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addOutput(FlatBufferBuilder builder, int outputOffset) { builder.addOffset(7, outputOffset, 0); }
|
||||
public static int createOutputVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addInt(data[i]); return builder.endVector(); }
|
||||
public static void startOutputVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addExtraParams(FlatBufferBuilder builder, int extraParamsOffset) { builder.addOffset(8, extraParamsOffset, 0); }
|
||||
public static int createExtraParamsVector(FlatBufferBuilder builder, double[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addDouble(data[i]); return builder.endVector(); }
|
||||
public static void startExtraParamsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
|
||||
public static void addExtraInteger(FlatBufferBuilder builder, int extraIntegerOffset) { builder.addOffset(9, extraIntegerOffset, 0); }
|
||||
public static int createExtraIntegerVector(FlatBufferBuilder builder, long[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addLong(data[i]); return builder.endVector(); }
|
||||
public static void startExtraIntegerVector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
|
||||
public static void addExtraBools(FlatBufferBuilder builder, int extraBoolsOffset) { builder.addOffset(10, extraBoolsOffset, 0); }
|
||||
public static int createExtraBoolsVector(FlatBufferBuilder builder, boolean[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addBoolean(data[i]); return builder.endVector(); }
|
||||
public static void startExtraBoolsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
|
||||
public static void addDimensions(FlatBufferBuilder builder, int dimensionsOffset) { builder.addOffset(11, dimensionsOffset, 0); }
|
||||
public static int createDimensionsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addInt(data[i]); return builder.endVector(); }
|
||||
public static void startDimensionsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addDevice(FlatBufferBuilder builder, int device) { builder.addInt(12, device, 0); }
|
||||
public static void addScopeId(FlatBufferBuilder builder, int scopeId) { builder.addInt(13, scopeId, 0); }
|
||||
public static void addScopeName(FlatBufferBuilder builder, int scopeNameOffset) { builder.addOffset(14, scopeNameOffset, 0); }
|
||||
public static void addOutputNames(FlatBufferBuilder builder, int outputNamesOffset) { builder.addOffset(15, outputNamesOffset, 0); }
|
||||
public static int createOutputNamesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startOutputNamesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addOpName(FlatBufferBuilder builder, int opNameOffset) { builder.addOffset(16, opNameOffset, 0); }
|
||||
public static void addOutputTypes(FlatBufferBuilder builder, int outputTypesOffset) { builder.addOffset(17, outputTypesOffset, 0); }
|
||||
public static int createOutputTypesVector(FlatBufferBuilder builder, byte[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addByte(data[i]); return builder.endVector(); }
|
||||
public static void startOutputTypesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
|
||||
public static void addScalar(FlatBufferBuilder builder, int scalarOffset) { builder.addOffset(18, scalarOffset, 0); }
|
||||
public static void addControlDeps(FlatBufferBuilder builder, int controlDepsOffset) { builder.addOffset(19, controlDepsOffset, 0); }
|
||||
public static int createControlDepsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startControlDepsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addVarControlDeps(FlatBufferBuilder builder, int varControlDepsOffset) { builder.addOffset(20, varControlDepsOffset, 0); }
|
||||
public static int createVarControlDepsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startVarControlDepsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addControlDepFor(FlatBufferBuilder builder, int controlDepForOffset) { builder.addOffset(21, controlDepForOffset, 0); }
|
||||
public static int createControlDepForVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startControlDepForVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addExtraTypes(FlatBufferBuilder builder, int extraTypesOffset) { builder.addOffset(22, extraTypesOffset, 0); }
|
||||
public static int createExtraTypesVector(FlatBufferBuilder builder, byte[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addByte(data[i]); return builder.endVector(); }
|
||||
public static void startExtraTypesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
|
||||
public static int endFlatNode(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatNodeBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatNodeBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,416 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatNode(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatNode(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatNode()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatNode
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatNode
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def Name(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FlatNode
|
||||
def OpType(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def OpNum(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def Properties(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatProperties import FlatProperties
|
||||
obj = FlatProperties()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatNode
|
||||
def PropertiesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def Input(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def InputAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def InputLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def InputPaired(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .IntPair import IntPair
|
||||
obj = IntPair()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatNode
|
||||
def InputPairedLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def Output(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def OutputAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def OutputLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraParams(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraParamsAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraParamsLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraInteger(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraIntegerAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraIntegerLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraBools(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.BoolFlags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraBoolsAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.BoolFlags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraBoolsLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def Dimensions(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def DimensionsAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def DimensionsLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def Device(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ScopeId(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ScopeName(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FlatNode
|
||||
def OutputNames(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatNode
|
||||
def OutputNamesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def OpName(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FlatNode
|
||||
def OutputTypes(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def OutputTypesAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int8Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def OutputTypesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def Scalar(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .FlatArray import FlatArray
|
||||
obj = FlatArray()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatNode
|
||||
def ControlDeps(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatNode
|
||||
def ControlDepsLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def VarControlDeps(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatNode
|
||||
def VarControlDepsLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ControlDepFor(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(46))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatNode
|
||||
def ControlDepForLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(46))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraTypes(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(48))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraTypesAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(48))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int8Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatNode
|
||||
def ExtraTypesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(48))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
def FlatNodeStart(builder): builder.StartObject(23)
|
||||
def FlatNodeAddId(builder, id): builder.PrependInt32Slot(0, id, 0)
|
||||
def FlatNodeAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
|
||||
def FlatNodeAddOpType(builder, opType): builder.PrependInt8Slot(2, opType, 0)
|
||||
def FlatNodeAddOpNum(builder, opNum): builder.PrependInt64Slot(3, opNum, 0)
|
||||
def FlatNodeAddProperties(builder, properties): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(properties), 0)
|
||||
def FlatNodeStartPropertiesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddInput(builder, input): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(input), 0)
|
||||
def FlatNodeStartInputVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddInputPaired(builder, inputPaired): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(inputPaired), 0)
|
||||
def FlatNodeStartInputPairedVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddOutput(builder, output): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(output), 0)
|
||||
def FlatNodeStartOutputVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddExtraParams(builder, extraParams): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(extraParams), 0)
|
||||
def FlatNodeStartExtraParamsVector(builder, numElems): return builder.StartVector(8, numElems, 8)
|
||||
def FlatNodeAddExtraInteger(builder, extraInteger): builder.PrependUOffsetTRelativeSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(extraInteger), 0)
|
||||
def FlatNodeStartExtraIntegerVector(builder, numElems): return builder.StartVector(8, numElems, 8)
|
||||
def FlatNodeAddExtraBools(builder, extraBools): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(extraBools), 0)
|
||||
def FlatNodeStartExtraBoolsVector(builder, numElems): return builder.StartVector(1, numElems, 1)
|
||||
def FlatNodeAddDimensions(builder, dimensions): builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(dimensions), 0)
|
||||
def FlatNodeStartDimensionsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddDevice(builder, device): builder.PrependInt32Slot(12, device, 0)
|
||||
def FlatNodeAddScopeId(builder, scopeId): builder.PrependInt32Slot(13, scopeId, 0)
|
||||
def FlatNodeAddScopeName(builder, scopeName): builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(scopeName), 0)
|
||||
def FlatNodeAddOutputNames(builder, outputNames): builder.PrependUOffsetTRelativeSlot(15, flatbuffers.number_types.UOffsetTFlags.py_type(outputNames), 0)
|
||||
def FlatNodeStartOutputNamesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddOpName(builder, opName): builder.PrependUOffsetTRelativeSlot(16, flatbuffers.number_types.UOffsetTFlags.py_type(opName), 0)
|
||||
def FlatNodeAddOutputTypes(builder, outputTypes): builder.PrependUOffsetTRelativeSlot(17, flatbuffers.number_types.UOffsetTFlags.py_type(outputTypes), 0)
|
||||
def FlatNodeStartOutputTypesVector(builder, numElems): return builder.StartVector(1, numElems, 1)
|
||||
def FlatNodeAddScalar(builder, scalar): builder.PrependUOffsetTRelativeSlot(18, flatbuffers.number_types.UOffsetTFlags.py_type(scalar), 0)
|
||||
def FlatNodeAddControlDeps(builder, controlDeps): builder.PrependUOffsetTRelativeSlot(19, flatbuffers.number_types.UOffsetTFlags.py_type(controlDeps), 0)
|
||||
def FlatNodeStartControlDepsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddVarControlDeps(builder, varControlDeps): builder.PrependUOffsetTRelativeSlot(20, flatbuffers.number_types.UOffsetTFlags.py_type(varControlDeps), 0)
|
||||
def FlatNodeStartVarControlDepsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddControlDepFor(builder, controlDepFor): builder.PrependUOffsetTRelativeSlot(21, flatbuffers.number_types.UOffsetTFlags.py_type(controlDepFor), 0)
|
||||
def FlatNodeStartControlDepForVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatNodeAddExtraTypes(builder, extraTypes): builder.PrependUOffsetTRelativeSlot(22, flatbuffers.number_types.UOffsetTFlags.py_type(extraTypes), 0)
|
||||
def FlatNodeStartExtraTypesVector(builder, numElems): return builder.StartVector(1, numElems, 1)
|
||||
def FlatNodeEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,132 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatProperties : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatProperties GetRootAsFlatProperties(ByteBuffer _bb) { return GetRootAsFlatProperties(_bb, new FlatProperties()); }
|
||||
public static FlatProperties GetRootAsFlatProperties(ByteBuffer _bb, FlatProperties obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatProperties __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetNameBytes() { return __p.__vector_as_span(4); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
|
||||
#endif
|
||||
public byte[] GetNameArray() { return __p.__vector_as_array<byte>(4); }
|
||||
public int I(int j) { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int)0; }
|
||||
public int ILength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetIBytes() { return __p.__vector_as_span(6); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetIBytes() { return __p.__vector_as_arraysegment(6); }
|
||||
#endif
|
||||
public int[] GetIArray() { return __p.__vector_as_array<int>(6); }
|
||||
public long L(int j) { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
|
||||
public int LLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetLBytes() { return __p.__vector_as_span(8); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetLBytes() { return __p.__vector_as_arraysegment(8); }
|
||||
#endif
|
||||
public long[] GetLArray() { return __p.__vector_as_array<long>(8); }
|
||||
public double D(int j) { int o = __p.__offset(10); return o != 0 ? __p.bb.GetDouble(__p.__vector(o) + j * 8) : (double)0; }
|
||||
public int DLength { get { int o = __p.__offset(10); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetDBytes() { return __p.__vector_as_span(10); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetDBytes() { return __p.__vector_as_arraysegment(10); }
|
||||
#endif
|
||||
public double[] GetDArray() { return __p.__vector_as_array<double>(10); }
|
||||
public FlatArray? A(int j) { int o = __p.__offset(12); return o != 0 ? (FlatArray?)(new FlatArray()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int ALength { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public bool B(int j) { int o = __p.__offset(14); return o != 0 ? 0!=__p.bb.Get(__p.__vector(o) + j * 1) : false; }
|
||||
public int BLength { get { int o = __p.__offset(14); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetBBytes() { return __p.__vector_as_span(14); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetBBytes() { return __p.__vector_as_arraysegment(14); }
|
||||
#endif
|
||||
public bool[] GetBArray() { return __p.__vector_as_array<bool>(14); }
|
||||
public string S(int j) { int o = __p.__offset(16); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int SLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public int Shape(int j) { int o = __p.__offset(18); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int)0; }
|
||||
public int ShapeLength { get { int o = __p.__offset(18); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetShapeBytes() { return __p.__vector_as_span(18); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetShapeBytes() { return __p.__vector_as_arraysegment(18); }
|
||||
#endif
|
||||
public int[] GetShapeArray() { return __p.__vector_as_array<int>(18); }
|
||||
|
||||
public static Offset<FlatProperties> CreateFlatProperties(FlatBufferBuilder builder,
|
||||
StringOffset nameOffset = default(StringOffset),
|
||||
VectorOffset iOffset = default(VectorOffset),
|
||||
VectorOffset lOffset = default(VectorOffset),
|
||||
VectorOffset dOffset = default(VectorOffset),
|
||||
VectorOffset aOffset = default(VectorOffset),
|
||||
VectorOffset bOffset = default(VectorOffset),
|
||||
VectorOffset sOffset = default(VectorOffset),
|
||||
VectorOffset shapeOffset = default(VectorOffset)) {
|
||||
builder.StartObject(8);
|
||||
FlatProperties.AddShape(builder, shapeOffset);
|
||||
FlatProperties.AddS(builder, sOffset);
|
||||
FlatProperties.AddB(builder, bOffset);
|
||||
FlatProperties.AddA(builder, aOffset);
|
||||
FlatProperties.AddD(builder, dOffset);
|
||||
FlatProperties.AddL(builder, lOffset);
|
||||
FlatProperties.AddI(builder, iOffset);
|
||||
FlatProperties.AddName(builder, nameOffset);
|
||||
return FlatProperties.EndFlatProperties(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatProperties(FlatBufferBuilder builder) { builder.StartObject(8); }
|
||||
public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(0, nameOffset.Value, 0); }
|
||||
public static void AddI(FlatBufferBuilder builder, VectorOffset iOffset) { builder.AddOffset(1, iOffset.Value, 0); }
|
||||
public static VectorOffset CreateIVector(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateIVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartIVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddL(FlatBufferBuilder builder, VectorOffset lOffset) { builder.AddOffset(2, lOffset.Value, 0); }
|
||||
public static VectorOffset CreateLVector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateLVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartLVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
|
||||
public static void AddD(FlatBufferBuilder builder, VectorOffset dOffset) { builder.AddOffset(3, dOffset.Value, 0); }
|
||||
public static VectorOffset CreateDVector(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddDouble(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateDVectorBlock(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartDVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
|
||||
public static void AddA(FlatBufferBuilder builder, VectorOffset aOffset) { builder.AddOffset(4, aOffset.Value, 0); }
|
||||
public static VectorOffset CreateAVector(FlatBufferBuilder builder, Offset<FlatArray>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateAVectorBlock(FlatBufferBuilder builder, Offset<FlatArray>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartAVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddB(FlatBufferBuilder builder, VectorOffset bOffset) { builder.AddOffset(5, bOffset.Value, 0); }
|
||||
public static VectorOffset CreateBVector(FlatBufferBuilder builder, bool[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddBool(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateBVectorBlock(FlatBufferBuilder builder, bool[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartBVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
|
||||
public static void AddS(FlatBufferBuilder builder, VectorOffset sOffset) { builder.AddOffset(6, sOffset.Value, 0); }
|
||||
public static VectorOffset CreateSVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateSVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartSVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddShape(FlatBufferBuilder builder, VectorOffset shapeOffset) { builder.AddOffset(7, shapeOffset.Value, 0); }
|
||||
public static VectorOffset CreateShapeVector(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateShapeVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartShapeVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static Offset<FlatProperties> EndFlatProperties(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatProperties>(o);
|
||||
}
|
||||
public static void FinishFlatPropertiesBuffer(FlatBufferBuilder builder, Offset<FlatProperties> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatPropertiesBuffer(FlatBufferBuilder builder, Offset<FlatProperties> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatProperties extends Table {
|
||||
public static FlatProperties getRootAsFlatProperties(ByteBuffer _bb) { return getRootAsFlatProperties(_bb, new FlatProperties()); }
|
||||
public static FlatProperties getRootAsFlatProperties(ByteBuffer _bb, FlatProperties obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatProperties __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public String name() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(4, 1); }
|
||||
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 4, 1); }
|
||||
public int i(int j) { int o = __offset(6); return o != 0 ? bb.getInt(__vector(o) + j * 4) : 0; }
|
||||
public int iLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer iAsByteBuffer() { return __vector_as_bytebuffer(6, 4); }
|
||||
public ByteBuffer iInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 4); }
|
||||
public long l(int j) { int o = __offset(8); return o != 0 ? bb.getLong(__vector(o) + j * 8) : 0; }
|
||||
public int lLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer lAsByteBuffer() { return __vector_as_bytebuffer(8, 8); }
|
||||
public ByteBuffer lInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 8, 8); }
|
||||
public double d(int j) { int o = __offset(10); return o != 0 ? bb.getDouble(__vector(o) + j * 8) : 0; }
|
||||
public int dLength() { int o = __offset(10); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer dAsByteBuffer() { return __vector_as_bytebuffer(10, 8); }
|
||||
public ByteBuffer dInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 10, 8); }
|
||||
public FlatArray a(int j) { return a(new FlatArray(), j); }
|
||||
public FlatArray a(FlatArray obj, int j) { int o = __offset(12); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int aLength() { int o = __offset(12); return o != 0 ? __vector_len(o) : 0; }
|
||||
public boolean b(int j) { int o = __offset(14); return o != 0 ? 0!=bb.get(__vector(o) + j * 1) : false; }
|
||||
public int bLength() { int o = __offset(14); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer bAsByteBuffer() { return __vector_as_bytebuffer(14, 1); }
|
||||
public ByteBuffer bInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 14, 1); }
|
||||
public String s(int j) { int o = __offset(16); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int sLength() { int o = __offset(16); return o != 0 ? __vector_len(o) : 0; }
|
||||
public int shape(int j) { int o = __offset(18); return o != 0 ? bb.getInt(__vector(o) + j * 4) : 0; }
|
||||
public int shapeLength() { int o = __offset(18); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer shapeAsByteBuffer() { return __vector_as_bytebuffer(18, 4); }
|
||||
public ByteBuffer shapeInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 18, 4); }
|
||||
|
||||
public static int createFlatProperties(FlatBufferBuilder builder,
|
||||
int nameOffset,
|
||||
int iOffset,
|
||||
int lOffset,
|
||||
int dOffset,
|
||||
int aOffset,
|
||||
int bOffset,
|
||||
int sOffset,
|
||||
int shapeOffset) {
|
||||
builder.startObject(8);
|
||||
FlatProperties.addShape(builder, shapeOffset);
|
||||
FlatProperties.addS(builder, sOffset);
|
||||
FlatProperties.addB(builder, bOffset);
|
||||
FlatProperties.addA(builder, aOffset);
|
||||
FlatProperties.addD(builder, dOffset);
|
||||
FlatProperties.addL(builder, lOffset);
|
||||
FlatProperties.addI(builder, iOffset);
|
||||
FlatProperties.addName(builder, nameOffset);
|
||||
return FlatProperties.endFlatProperties(builder);
|
||||
}
|
||||
|
||||
public static void startFlatProperties(FlatBufferBuilder builder) { builder.startObject(8); }
|
||||
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(0, nameOffset, 0); }
|
||||
public static void addI(FlatBufferBuilder builder, int iOffset) { builder.addOffset(1, iOffset, 0); }
|
||||
public static int createIVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addInt(data[i]); return builder.endVector(); }
|
||||
public static void startIVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addL(FlatBufferBuilder builder, int lOffset) { builder.addOffset(2, lOffset, 0); }
|
||||
public static int createLVector(FlatBufferBuilder builder, long[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addLong(data[i]); return builder.endVector(); }
|
||||
public static void startLVector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
|
||||
public static void addD(FlatBufferBuilder builder, int dOffset) { builder.addOffset(3, dOffset, 0); }
|
||||
public static int createDVector(FlatBufferBuilder builder, double[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addDouble(data[i]); return builder.endVector(); }
|
||||
public static void startDVector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
|
||||
public static void addA(FlatBufferBuilder builder, int aOffset) { builder.addOffset(4, aOffset, 0); }
|
||||
public static int createAVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startAVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addB(FlatBufferBuilder builder, int bOffset) { builder.addOffset(5, bOffset, 0); }
|
||||
public static int createBVector(FlatBufferBuilder builder, boolean[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addBoolean(data[i]); return builder.endVector(); }
|
||||
public static void startBVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
|
||||
public static void addS(FlatBufferBuilder builder, int sOffset) { builder.addOffset(6, sOffset, 0); }
|
||||
public static int createSVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startSVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addShape(FlatBufferBuilder builder, int shapeOffset) { builder.addOffset(7, shapeOffset, 0); }
|
||||
public static int createShapeVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addInt(data[i]); return builder.endVector(); }
|
||||
public static void startShapeVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static int endFlatProperties(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatPropertiesBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatPropertiesBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatProperties(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatProperties(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatProperties()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatProperties
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatProperties
|
||||
def Name(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FlatProperties
|
||||
def I(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def IAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def ILength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def L(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def LAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def LLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def D(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def DAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def DLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def A(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatArray import FlatArray
|
||||
obj = FlatArray()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatProperties
|
||||
def ALength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def B(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.BoolFlags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def BAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.BoolFlags, o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def BLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def S(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatProperties
|
||||
def SLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def Shape(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def ShapeAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatProperties
|
||||
def ShapeLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
def FlatPropertiesStart(builder): builder.StartObject(8)
|
||||
def FlatPropertiesAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
|
||||
def FlatPropertiesAddI(builder, i): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(i), 0)
|
||||
def FlatPropertiesStartIVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatPropertiesAddL(builder, l): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(l), 0)
|
||||
def FlatPropertiesStartLVector(builder, numElems): return builder.StartVector(8, numElems, 8)
|
||||
def FlatPropertiesAddD(builder, d): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(d), 0)
|
||||
def FlatPropertiesStartDVector(builder, numElems): return builder.StartVector(8, numElems, 8)
|
||||
def FlatPropertiesAddA(builder, a): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(a), 0)
|
||||
def FlatPropertiesStartAVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatPropertiesAddB(builder, b): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(b), 0)
|
||||
def FlatPropertiesStartBVector(builder, numElems): return builder.StartVector(1, numElems, 1)
|
||||
def FlatPropertiesAddS(builder, s): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(s), 0)
|
||||
def FlatPropertiesStartSVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatPropertiesAddShape(builder, shape): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(shape), 0)
|
||||
def FlatPropertiesStartShapeVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatPropertiesEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,38 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatResponse : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatResponse GetRootAsFlatResponse(ByteBuffer _bb) { return GetRootAsFlatResponse(_bb, new FlatResponse()); }
|
||||
public static FlatResponse GetRootAsFlatResponse(ByteBuffer _bb, FlatResponse obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatResponse __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int Status { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
|
||||
public static Offset<FlatResponse> CreateFlatResponse(FlatBufferBuilder builder,
|
||||
int status = 0) {
|
||||
builder.StartObject(1);
|
||||
FlatResponse.AddStatus(builder, status);
|
||||
return FlatResponse.EndFlatResponse(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatResponse(FlatBufferBuilder builder) { builder.StartObject(1); }
|
||||
public static void AddStatus(FlatBufferBuilder builder, int status) { builder.AddInt(0, status, 0); }
|
||||
public static Offset<FlatResponse> EndFlatResponse(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatResponse>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatResponse extends Table {
|
||||
public static FlatResponse getRootAsFlatResponse(ByteBuffer _bb) { return getRootAsFlatResponse(_bb, new FlatResponse()); }
|
||||
public static FlatResponse getRootAsFlatResponse(ByteBuffer _bb, FlatResponse obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatResponse __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int status() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
|
||||
public static int createFlatResponse(FlatBufferBuilder builder,
|
||||
int status) {
|
||||
builder.startObject(1);
|
||||
FlatResponse.addStatus(builder, status);
|
||||
return FlatResponse.endFlatResponse(builder);
|
||||
}
|
||||
|
||||
public static void startFlatResponse(FlatBufferBuilder builder) { builder.startObject(1); }
|
||||
public static void addStatus(FlatBufferBuilder builder, int status) { builder.addInt(0, status, 0); }
|
||||
public static int endFlatResponse(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatResponse(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatResponse(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatResponse()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatResponse
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatResponse
|
||||
def Status(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def FlatResponseStart(builder): builder.StartObject(1)
|
||||
def FlatResponseAddStatus(builder, status): builder.PrependInt32Slot(0, status, 0)
|
||||
def FlatResponseEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,64 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatResult : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatResult GetRootAsFlatResult(ByteBuffer _bb) { return GetRootAsFlatResult(_bb, new FlatResult()); }
|
||||
public static FlatResult GetRootAsFlatResult(ByteBuffer _bb, FlatResult obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatResult __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public FlatVariable? Variables(int j) { int o = __p.__offset(6); return o != 0 ? (FlatVariable?)(new FlatVariable()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int VariablesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public FlatTiming? Timing(int j) { int o = __p.__offset(8); return o != 0 ? (FlatTiming?)(new FlatTiming()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||||
public int TimingLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public long FootprintForward { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public long FootprintBackward { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
|
||||
public static Offset<FlatResult> CreateFlatResult(FlatBufferBuilder builder,
|
||||
long id = 0,
|
||||
VectorOffset variablesOffset = default(VectorOffset),
|
||||
VectorOffset timingOffset = default(VectorOffset),
|
||||
long footprintForward = 0,
|
||||
long footprintBackward = 0) {
|
||||
builder.StartObject(5);
|
||||
FlatResult.AddFootprintBackward(builder, footprintBackward);
|
||||
FlatResult.AddFootprintForward(builder, footprintForward);
|
||||
FlatResult.AddId(builder, id);
|
||||
FlatResult.AddTiming(builder, timingOffset);
|
||||
FlatResult.AddVariables(builder, variablesOffset);
|
||||
return FlatResult.EndFlatResult(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatResult(FlatBufferBuilder builder) { builder.StartObject(5); }
|
||||
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
|
||||
public static void AddVariables(FlatBufferBuilder builder, VectorOffset variablesOffset) { builder.AddOffset(1, variablesOffset.Value, 0); }
|
||||
public static VectorOffset CreateVariablesVector(FlatBufferBuilder builder, Offset<FlatVariable>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateVariablesVectorBlock(FlatBufferBuilder builder, Offset<FlatVariable>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartVariablesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddTiming(FlatBufferBuilder builder, VectorOffset timingOffset) { builder.AddOffset(2, timingOffset.Value, 0); }
|
||||
public static VectorOffset CreateTimingVector(FlatBufferBuilder builder, Offset<FlatTiming>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateTimingVectorBlock(FlatBufferBuilder builder, Offset<FlatTiming>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartTimingVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddFootprintForward(FlatBufferBuilder builder, long footprintForward) { builder.AddLong(3, footprintForward, 0); }
|
||||
public static void AddFootprintBackward(FlatBufferBuilder builder, long footprintBackward) { builder.AddLong(4, footprintBackward, 0); }
|
||||
public static Offset<FlatResult> EndFlatResult(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatResult>(o);
|
||||
}
|
||||
public static void FinishFlatResultBuffer(FlatBufferBuilder builder, Offset<FlatResult> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatResultBuffer(FlatBufferBuilder builder, Offset<FlatResult> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatResult extends Table {
|
||||
public static FlatResult getRootAsFlatResult(ByteBuffer _bb) { return getRootAsFlatResult(_bb, new FlatResult()); }
|
||||
public static FlatResult getRootAsFlatResult(ByteBuffer _bb, FlatResult obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatResult __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long id() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public FlatVariable variables(int j) { return variables(new FlatVariable(), j); }
|
||||
public FlatVariable variables(FlatVariable obj, int j) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int variablesLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
|
||||
public FlatTiming timing(int j) { return timing(new FlatTiming(), j); }
|
||||
public FlatTiming timing(FlatTiming obj, int j) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
|
||||
public int timingLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }
|
||||
public long footprintForward() { int o = __offset(10); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public long footprintBackward() { int o = __offset(12); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
|
||||
public static int createFlatResult(FlatBufferBuilder builder,
|
||||
long id,
|
||||
int variablesOffset,
|
||||
int timingOffset,
|
||||
long footprintForward,
|
||||
long footprintBackward) {
|
||||
builder.startObject(5);
|
||||
FlatResult.addFootprintBackward(builder, footprintBackward);
|
||||
FlatResult.addFootprintForward(builder, footprintForward);
|
||||
FlatResult.addId(builder, id);
|
||||
FlatResult.addTiming(builder, timingOffset);
|
||||
FlatResult.addVariables(builder, variablesOffset);
|
||||
return FlatResult.endFlatResult(builder);
|
||||
}
|
||||
|
||||
public static void startFlatResult(FlatBufferBuilder builder) { builder.startObject(5); }
|
||||
public static void addId(FlatBufferBuilder builder, long id) { builder.addLong(0, id, 0L); }
|
||||
public static void addVariables(FlatBufferBuilder builder, int variablesOffset) { builder.addOffset(1, variablesOffset, 0); }
|
||||
public static int createVariablesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startVariablesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addTiming(FlatBufferBuilder builder, int timingOffset) { builder.addOffset(2, timingOffset, 0); }
|
||||
public static int createTimingVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startTimingVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addFootprintForward(FlatBufferBuilder builder, long footprintForward) { builder.addLong(3, footprintForward, 0L); }
|
||||
public static void addFootprintBackward(FlatBufferBuilder builder, long footprintBackward) { builder.addLong(4, footprintBackward, 0L); }
|
||||
public static int endFlatResult(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatResultBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatResultBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatResult(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatResult(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatResult()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatResult
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatResult
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatResult
|
||||
def Variables(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatVariable import FlatVariable
|
||||
obj = FlatVariable()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatResult
|
||||
def VariablesLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatResult
|
||||
def Timing(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
x = self._tab.Vector(o)
|
||||
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
||||
x = self._tab.Indirect(x)
|
||||
from .FlatTiming import FlatTiming
|
||||
obj = FlatTiming()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatResult
|
||||
def TimingLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatResult
|
||||
def FootprintForward(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatResult
|
||||
def FootprintBackward(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def FlatResultStart(builder): builder.StartObject(5)
|
||||
def FlatResultAddId(builder, id): builder.PrependInt64Slot(0, id, 0)
|
||||
def FlatResultAddVariables(builder, variables): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(variables), 0)
|
||||
def FlatResultStartVariablesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatResultAddTiming(builder, timing): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(timing), 0)
|
||||
def FlatResultStartTimingVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatResultAddFootprintForward(builder, footprintForward): builder.PrependInt64Slot(3, footprintForward, 0)
|
||||
def FlatResultAddFootprintBackward(builder, footprintBackward): builder.PrependInt64Slot(4, footprintBackward, 0)
|
||||
def FlatResultEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,52 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatTiming : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatTiming GetRootAsFlatTiming(ByteBuffer _bb) { return GetRootAsFlatTiming(_bb, new FlatTiming()); }
|
||||
public static FlatTiming GetRootAsFlatTiming(ByteBuffer _bb, FlatTiming obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatTiming __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public string Name { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetNameBytes() { return __p.__vector_as_span(6); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetNameBytes() { return __p.__vector_as_arraysegment(6); }
|
||||
#endif
|
||||
public byte[] GetNameArray() { return __p.__vector_as_array<byte>(6); }
|
||||
public LongPair? Timing { get { int o = __p.__offset(8); return o != 0 ? (LongPair?)(new LongPair()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
|
||||
|
||||
public static Offset<FlatTiming> CreateFlatTiming(FlatBufferBuilder builder,
|
||||
int id = 0,
|
||||
StringOffset nameOffset = default(StringOffset),
|
||||
Offset<LongPair> timingOffset = default(Offset<LongPair>)) {
|
||||
builder.StartObject(3);
|
||||
FlatTiming.AddTiming(builder, timingOffset);
|
||||
FlatTiming.AddName(builder, nameOffset);
|
||||
FlatTiming.AddId(builder, id);
|
||||
return FlatTiming.EndFlatTiming(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatTiming(FlatBufferBuilder builder) { builder.StartObject(3); }
|
||||
public static void AddId(FlatBufferBuilder builder, int id) { builder.AddInt(0, id, 0); }
|
||||
public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(1, nameOffset.Value, 0); }
|
||||
public static void AddTiming(FlatBufferBuilder builder, Offset<LongPair> timingOffset) { builder.AddOffset(2, timingOffset.Value, 0); }
|
||||
public static Offset<FlatTiming> EndFlatTiming(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatTiming>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatTiming extends Table {
|
||||
public static FlatTiming getRootAsFlatTiming(ByteBuffer _bb) { return getRootAsFlatTiming(_bb, new FlatTiming()); }
|
||||
public static FlatTiming getRootAsFlatTiming(ByteBuffer _bb, FlatTiming obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatTiming __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int id() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
|
||||
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
|
||||
public LongPair timing() { return timing(new LongPair()); }
|
||||
public LongPair timing(LongPair obj) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
|
||||
public static int createFlatTiming(FlatBufferBuilder builder,
|
||||
int id,
|
||||
int nameOffset,
|
||||
int timingOffset) {
|
||||
builder.startObject(3);
|
||||
FlatTiming.addTiming(builder, timingOffset);
|
||||
FlatTiming.addName(builder, nameOffset);
|
||||
FlatTiming.addId(builder, id);
|
||||
return FlatTiming.endFlatTiming(builder);
|
||||
}
|
||||
|
||||
public static void startFlatTiming(FlatBufferBuilder builder) { builder.startObject(3); }
|
||||
public static void addId(FlatBufferBuilder builder, int id) { builder.addInt(0, id, 0); }
|
||||
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
|
||||
public static void addTiming(FlatBufferBuilder builder, int timingOffset) { builder.addOffset(2, timingOffset, 0); }
|
||||
public static int endFlatTiming(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatTiming(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatTiming(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatTiming()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatTiming
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatTiming
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatTiming
|
||||
def Name(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FlatTiming
|
||||
def Timing(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .LongPair import LongPair
|
||||
obj = LongPair()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
def FlatTimingStart(builder): builder.StartObject(3)
|
||||
def FlatTimingAddId(builder, id): builder.PrependInt32Slot(0, id, 0)
|
||||
def FlatTimingAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
|
||||
def FlatTimingAddTiming(builder, timing): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(timing), 0)
|
||||
def FlatTimingEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,104 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FlatVariable : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FlatVariable GetRootAsFlatVariable(ByteBuffer _bb) { return GetRootAsFlatVariable(_bb, new FlatVariable()); }
|
||||
public static FlatVariable GetRootAsFlatVariable(ByteBuffer _bb, FlatVariable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FlatVariable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public IntPair? Id { get { int o = __p.__offset(4); return o != 0 ? (IntPair?)(new IntPair()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
|
||||
public string Name { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetNameBytes() { return __p.__vector_as_span(6); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetNameBytes() { return __p.__vector_as_arraysegment(6); }
|
||||
#endif
|
||||
public byte[] GetNameArray() { return __p.__vector_as_array<byte>(6); }
|
||||
public DType Dtype { get { int o = __p.__offset(8); return o != 0 ? (DType)__p.bb.GetSbyte(o + __p.bb_pos) : DType.INHERIT; } }
|
||||
public long Shape(int j) { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
|
||||
public int ShapeLength { get { int o = __p.__offset(10); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetShapeBytes() { return __p.__vector_as_span(10); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetShapeBytes() { return __p.__vector_as_arraysegment(10); }
|
||||
#endif
|
||||
public long[] GetShapeArray() { return __p.__vector_as_array<long>(10); }
|
||||
public FlatArray? Ndarray { get { int o = __p.__offset(12); return o != 0 ? (FlatArray?)(new FlatArray()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
|
||||
public int Device { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public VarType Variabletype { get { int o = __p.__offset(16); return o != 0 ? (VarType)__p.bb.GetSbyte(o + __p.bb_pos) : VarType.VARIABLE; } }
|
||||
public string ControlDeps(int j) { int o = __p.__offset(18); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int ControlDepsLength { get { int o = __p.__offset(18); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public string ControlDepForOp(int j) { int o = __p.__offset(20); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int ControlDepForOpLength { get { int o = __p.__offset(20); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
public string ControlDepsForVar(int j) { int o = __p.__offset(22); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
|
||||
public int ControlDepsForVarLength { get { int o = __p.__offset(22); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||||
|
||||
public static Offset<FlatVariable> CreateFlatVariable(FlatBufferBuilder builder,
|
||||
Offset<IntPair> idOffset = default(Offset<IntPair>),
|
||||
StringOffset nameOffset = default(StringOffset),
|
||||
DType dtype = DType.INHERIT,
|
||||
VectorOffset shapeOffset = default(VectorOffset),
|
||||
Offset<FlatArray> ndarrayOffset = default(Offset<FlatArray>),
|
||||
int device = 0,
|
||||
VarType variabletype = VarType.VARIABLE,
|
||||
VectorOffset controlDepsOffset = default(VectorOffset),
|
||||
VectorOffset controlDepForOpOffset = default(VectorOffset),
|
||||
VectorOffset controlDepsForVarOffset = default(VectorOffset)) {
|
||||
builder.StartObject(10);
|
||||
FlatVariable.AddControlDepsForVar(builder, controlDepsForVarOffset);
|
||||
FlatVariable.AddControlDepForOp(builder, controlDepForOpOffset);
|
||||
FlatVariable.AddControlDeps(builder, controlDepsOffset);
|
||||
FlatVariable.AddDevice(builder, device);
|
||||
FlatVariable.AddNdarray(builder, ndarrayOffset);
|
||||
FlatVariable.AddShape(builder, shapeOffset);
|
||||
FlatVariable.AddName(builder, nameOffset);
|
||||
FlatVariable.AddId(builder, idOffset);
|
||||
FlatVariable.AddVariabletype(builder, variabletype);
|
||||
FlatVariable.AddDtype(builder, dtype);
|
||||
return FlatVariable.EndFlatVariable(builder);
|
||||
}
|
||||
|
||||
public static void StartFlatVariable(FlatBufferBuilder builder) { builder.StartObject(10); }
|
||||
public static void AddId(FlatBufferBuilder builder, Offset<IntPair> idOffset) { builder.AddOffset(0, idOffset.Value, 0); }
|
||||
public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(1, nameOffset.Value, 0); }
|
||||
public static void AddDtype(FlatBufferBuilder builder, DType dtype) { builder.AddSbyte(2, (sbyte)dtype, 0); }
|
||||
public static void AddShape(FlatBufferBuilder builder, VectorOffset shapeOffset) { builder.AddOffset(3, shapeOffset.Value, 0); }
|
||||
public static VectorOffset CreateShapeVector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); }
|
||||
public static VectorOffset CreateShapeVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartShapeVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
|
||||
public static void AddNdarray(FlatBufferBuilder builder, Offset<FlatArray> ndarrayOffset) { builder.AddOffset(4, ndarrayOffset.Value, 0); }
|
||||
public static void AddDevice(FlatBufferBuilder builder, int device) { builder.AddInt(5, device, 0); }
|
||||
public static void AddVariabletype(FlatBufferBuilder builder, VarType variabletype) { builder.AddSbyte(6, (sbyte)variabletype, 0); }
|
||||
public static void AddControlDeps(FlatBufferBuilder builder, VectorOffset controlDepsOffset) { builder.AddOffset(7, controlDepsOffset.Value, 0); }
|
||||
public static VectorOffset CreateControlDepsVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateControlDepsVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartControlDepsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddControlDepForOp(FlatBufferBuilder builder, VectorOffset controlDepForOpOffset) { builder.AddOffset(8, controlDepForOpOffset.Value, 0); }
|
||||
public static VectorOffset CreateControlDepForOpVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateControlDepForOpVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartControlDepForOpVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static void AddControlDepsForVar(FlatBufferBuilder builder, VectorOffset controlDepsForVarOffset) { builder.AddOffset(9, controlDepsForVarOffset.Value, 0); }
|
||||
public static VectorOffset CreateControlDepsForVarVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
|
||||
public static VectorOffset CreateControlDepsForVarVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||||
public static void StartControlDepsForVarVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||||
public static Offset<FlatVariable> EndFlatVariable(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FlatVariable>(o);
|
||||
}
|
||||
public static void FinishFlatVariableBuffer(FlatBufferBuilder builder, Offset<FlatVariable> offset) { builder.Finish(offset.Value); }
|
||||
public static void FinishSizePrefixedFlatVariableBuffer(FlatBufferBuilder builder, Offset<FlatVariable> offset) { builder.FinishSizePrefixed(offset.Value); }
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FlatVariable extends Table {
|
||||
public static FlatVariable getRootAsFlatVariable(ByteBuffer _bb) { return getRootAsFlatVariable(_bb, new FlatVariable()); }
|
||||
public static FlatVariable getRootAsFlatVariable(ByteBuffer _bb, FlatVariable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FlatVariable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public IntPair id() { return id(new IntPair()); }
|
||||
public IntPair id(IntPair obj) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
|
||||
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
|
||||
public byte dtype() { int o = __offset(8); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public long shape(int j) { int o = __offset(10); return o != 0 ? bb.getLong(__vector(o) + j * 8) : 0; }
|
||||
public int shapeLength() { int o = __offset(10); return o != 0 ? __vector_len(o) : 0; }
|
||||
public ByteBuffer shapeAsByteBuffer() { return __vector_as_bytebuffer(10, 8); }
|
||||
public ByteBuffer shapeInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 10, 8); }
|
||||
public FlatArray ndarray() { return ndarray(new FlatArray()); }
|
||||
public FlatArray ndarray(FlatArray obj) { int o = __offset(12); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public int device() { int o = __offset(14); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public byte variabletype() { int o = __offset(16); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public String controlDeps(int j) { int o = __offset(18); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int controlDepsLength() { int o = __offset(18); return o != 0 ? __vector_len(o) : 0; }
|
||||
public String controlDepForOp(int j) { int o = __offset(20); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int controlDepForOpLength() { int o = __offset(20); return o != 0 ? __vector_len(o) : 0; }
|
||||
public String controlDepsForVar(int j) { int o = __offset(22); return o != 0 ? __string(__vector(o) + j * 4) : null; }
|
||||
public int controlDepsForVarLength() { int o = __offset(22); return o != 0 ? __vector_len(o) : 0; }
|
||||
|
||||
public static int createFlatVariable(FlatBufferBuilder builder,
|
||||
int idOffset,
|
||||
int nameOffset,
|
||||
byte dtype,
|
||||
int shapeOffset,
|
||||
int ndarrayOffset,
|
||||
int device,
|
||||
byte variabletype,
|
||||
int controlDepsOffset,
|
||||
int controlDepForOpOffset,
|
||||
int controlDepsForVarOffset) {
|
||||
builder.startObject(10);
|
||||
FlatVariable.addControlDepsForVar(builder, controlDepsForVarOffset);
|
||||
FlatVariable.addControlDepForOp(builder, controlDepForOpOffset);
|
||||
FlatVariable.addControlDeps(builder, controlDepsOffset);
|
||||
FlatVariable.addDevice(builder, device);
|
||||
FlatVariable.addNdarray(builder, ndarrayOffset);
|
||||
FlatVariable.addShape(builder, shapeOffset);
|
||||
FlatVariable.addName(builder, nameOffset);
|
||||
FlatVariable.addId(builder, idOffset);
|
||||
FlatVariable.addVariabletype(builder, variabletype);
|
||||
FlatVariable.addDtype(builder, dtype);
|
||||
return FlatVariable.endFlatVariable(builder);
|
||||
}
|
||||
|
||||
public static void startFlatVariable(FlatBufferBuilder builder) { builder.startObject(10); }
|
||||
public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addOffset(0, idOffset, 0); }
|
||||
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
|
||||
public static void addDtype(FlatBufferBuilder builder, byte dtype) { builder.addByte(2, dtype, 0); }
|
||||
public static void addShape(FlatBufferBuilder builder, int shapeOffset) { builder.addOffset(3, shapeOffset, 0); }
|
||||
public static int createShapeVector(FlatBufferBuilder builder, long[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addLong(data[i]); return builder.endVector(); }
|
||||
public static void startShapeVector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
|
||||
public static void addNdarray(FlatBufferBuilder builder, int ndarrayOffset) { builder.addOffset(4, ndarrayOffset, 0); }
|
||||
public static void addDevice(FlatBufferBuilder builder, int device) { builder.addInt(5, device, 0); }
|
||||
public static void addVariabletype(FlatBufferBuilder builder, byte variabletype) { builder.addByte(6, variabletype, 0); }
|
||||
public static void addControlDeps(FlatBufferBuilder builder, int controlDepsOffset) { builder.addOffset(7, controlDepsOffset, 0); }
|
||||
public static int createControlDepsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startControlDepsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addControlDepForOp(FlatBufferBuilder builder, int controlDepForOpOffset) { builder.addOffset(8, controlDepForOpOffset, 0); }
|
||||
public static int createControlDepForOpVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startControlDepForOpVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static void addControlDepsForVar(FlatBufferBuilder builder, int controlDepsForVarOffset) { builder.addOffset(9, controlDepsForVarOffset, 0); }
|
||||
public static int createControlDepsForVarVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
|
||||
public static void startControlDepsForVarVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
|
||||
public static int endFlatVariable(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
public static void finishFlatVariableBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
|
||||
public static void finishSizePrefixedFlatVariableBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FlatVariable(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFlatVariable(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FlatVariable()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FlatVariable
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FlatVariable
|
||||
def Id(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .IntPair import IntPair
|
||||
obj = IntPair()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatVariable
|
||||
def Name(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FlatVariable
|
||||
def Dtype(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def Shape(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def ShapeAsNumpy(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def ShapeLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def Ndarray(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .FlatArray import FlatArray
|
||||
obj = FlatArray()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# FlatVariable
|
||||
def Device(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def Variabletype(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def ControlDeps(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatVariable
|
||||
def ControlDepsLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def ControlDepForOp(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatVariable
|
||||
def ControlDepForOpLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
# FlatVariable
|
||||
def ControlDepsForVar(self, j):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
|
||||
if o != 0:
|
||||
a = self._tab.Vector(o)
|
||||
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
||||
return ""
|
||||
|
||||
# FlatVariable
|
||||
def ControlDepsForVarLength(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
|
||||
if o != 0:
|
||||
return self._tab.VectorLen(o)
|
||||
return 0
|
||||
|
||||
def FlatVariableStart(builder): builder.StartObject(10)
|
||||
def FlatVariableAddId(builder, id): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(id), 0)
|
||||
def FlatVariableAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
|
||||
def FlatVariableAddDtype(builder, dtype): builder.PrependInt8Slot(2, dtype, 0)
|
||||
def FlatVariableAddShape(builder, shape): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(shape), 0)
|
||||
def FlatVariableStartShapeVector(builder, numElems): return builder.StartVector(8, numElems, 8)
|
||||
def FlatVariableAddNdarray(builder, ndarray): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(ndarray), 0)
|
||||
def FlatVariableAddDevice(builder, device): builder.PrependInt32Slot(5, device, 0)
|
||||
def FlatVariableAddVariabletype(builder, variabletype): builder.PrependInt8Slot(6, variabletype, 0)
|
||||
def FlatVariableAddControlDeps(builder, controlDeps): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(controlDeps), 0)
|
||||
def FlatVariableStartControlDepsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatVariableAddControlDepForOp(builder, controlDepForOp): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(controlDepForOp), 0)
|
||||
def FlatVariableStartControlDepForOpVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatVariableAddControlDepsForVar(builder, controlDepsForVar): builder.PrependUOffsetTRelativeSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(controlDepsForVar), 0)
|
||||
def FlatVariableStartControlDepsForVarVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
||||
def FlatVariableEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,48 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct FrameIteration : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static FrameIteration GetRootAsFrameIteration(ByteBuffer _bb) { return GetRootAsFrameIteration(_bb, new FrameIteration()); }
|
||||
public static FrameIteration GetRootAsFrameIteration(ByteBuffer _bb, FrameIteration obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public FrameIteration __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public string Frame { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetFrameBytes() { return __p.__vector_as_span(4); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetFrameBytes() { return __p.__vector_as_arraysegment(4); }
|
||||
#endif
|
||||
public byte[] GetFrameArray() { return __p.__vector_as_array<byte>(4); }
|
||||
public ushort Iteration { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
|
||||
|
||||
public static Offset<FrameIteration> CreateFrameIteration(FlatBufferBuilder builder,
|
||||
StringOffset frameOffset = default(StringOffset),
|
||||
ushort iteration = 0) {
|
||||
builder.StartObject(2);
|
||||
FrameIteration.AddFrame(builder, frameOffset);
|
||||
FrameIteration.AddIteration(builder, iteration);
|
||||
return FrameIteration.EndFrameIteration(builder);
|
||||
}
|
||||
|
||||
public static void StartFrameIteration(FlatBufferBuilder builder) { builder.StartObject(2); }
|
||||
public static void AddFrame(FlatBufferBuilder builder, StringOffset frameOffset) { builder.AddOffset(0, frameOffset.Value, 0); }
|
||||
public static void AddIteration(FlatBufferBuilder builder, ushort iteration) { builder.AddUshort(1, iteration, 0); }
|
||||
public static Offset<FrameIteration> EndFrameIteration(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<FrameIteration>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class FrameIteration extends Table {
|
||||
public static FrameIteration getRootAsFrameIteration(ByteBuffer _bb) { return getRootAsFrameIteration(_bb, new FrameIteration()); }
|
||||
public static FrameIteration getRootAsFrameIteration(ByteBuffer _bb, FrameIteration obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public FrameIteration __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public String frame() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer frameAsByteBuffer() { return __vector_as_bytebuffer(4, 1); }
|
||||
public ByteBuffer frameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 4, 1); }
|
||||
public int iteration() { int o = __offset(6); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
|
||||
|
||||
public static int createFrameIteration(FlatBufferBuilder builder,
|
||||
int frameOffset,
|
||||
int iteration) {
|
||||
builder.startObject(2);
|
||||
FrameIteration.addFrame(builder, frameOffset);
|
||||
FrameIteration.addIteration(builder, iteration);
|
||||
return FrameIteration.endFrameIteration(builder);
|
||||
}
|
||||
|
||||
public static void startFrameIteration(FlatBufferBuilder builder) { builder.startObject(2); }
|
||||
public static void addFrame(FlatBufferBuilder builder, int frameOffset) { builder.addOffset(0, frameOffset, 0); }
|
||||
public static void addIteration(FlatBufferBuilder builder, int iteration) { builder.addShort(1, (short)iteration, (short)0); }
|
||||
public static int endFrameIteration(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class FrameIteration(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsFrameIteration(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = FrameIteration()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# FrameIteration
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# FrameIteration
|
||||
def Frame(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
# FrameIteration
|
||||
def Iteration(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def FrameIterationStart(builder): builder.StartObject(2)
|
||||
def FrameIterationAddFrame(builder, frame): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(frame), 0)
|
||||
def FrameIterationAddIteration(builder, iteration): builder.PrependUint16Slot(1, iteration, 0)
|
||||
def FrameIterationEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,551 @@
|
|||
//Generated by flatc compiler (version 1.10.0)
|
||||
//If you make any local changes, they will be lost
|
||||
//source: graph.fbs
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import com.google.flatbuffers.grpc.FlatbuffersUtils;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.futureUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
||||
|
||||
/**
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = "by gRPC proto compiler",
|
||||
comments = "Source: graph.fbs")
|
||||
public final class GraphInferenceServerGrpc {
|
||||
|
||||
private GraphInferenceServerGrpc() {}
|
||||
|
||||
public static final String SERVICE_NAME = "nd4j.graph.GraphInferenceServer";
|
||||
|
||||
// Static method descriptors that strictly reflect the proto.
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
@java.lang.Deprecated // Use {@link #getRegisterGraphMethod()} instead.
|
||||
public static final io.grpc.MethodDescriptor<nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse> METHOD_REGISTER_GRAPH = getRegisterGraphMethod();
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse> getRegisterGraphMethod;
|
||||
|
||||
private static volatile FlatbuffersUtils.FBExtactor<nd4j.graph.FlatGraph> extractorOfFlatGraph;
|
||||
private static FlatbuffersUtils.FBExtactor<nd4j.graph.FlatGraph> getExtractorOfFlatGraph() {
|
||||
if (extractorOfFlatGraph != null) return extractorOfFlatGraph;
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if (extractorOfFlatGraph != null) return extractorOfFlatGraph;
|
||||
extractorOfFlatGraph = new FlatbuffersUtils.FBExtactor<nd4j.graph.FlatGraph>() {
|
||||
public nd4j.graph.FlatGraph extract (ByteBuffer buffer) {
|
||||
return nd4j.graph.FlatGraph.getRootAsFlatGraph(buffer);
|
||||
}
|
||||
};
|
||||
return extractorOfFlatGraph;
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile FlatbuffersUtils.FBExtactor<nd4j.graph.FlatResponse> extractorOfFlatResponse;
|
||||
private static FlatbuffersUtils.FBExtactor<nd4j.graph.FlatResponse> getExtractorOfFlatResponse() {
|
||||
if (extractorOfFlatResponse != null) return extractorOfFlatResponse;
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if (extractorOfFlatResponse != null) return extractorOfFlatResponse;
|
||||
extractorOfFlatResponse = new FlatbuffersUtils.FBExtactor<nd4j.graph.FlatResponse>() {
|
||||
public nd4j.graph.FlatResponse extract (ByteBuffer buffer) {
|
||||
return nd4j.graph.FlatResponse.getRootAsFlatResponse(buffer);
|
||||
}
|
||||
};
|
||||
return extractorOfFlatResponse;
|
||||
}
|
||||
}
|
||||
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
public static io.grpc.MethodDescriptor<nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse> getRegisterGraphMethod() {
|
||||
io.grpc.MethodDescriptor<nd4j.graph.FlatGraph, nd4j.graph.FlatResponse> getRegisterGraphMethod;
|
||||
if ((getRegisterGraphMethod = GraphInferenceServerGrpc.getRegisterGraphMethod) == null) {
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if ((getRegisterGraphMethod = GraphInferenceServerGrpc.getRegisterGraphMethod) == null) {
|
||||
GraphInferenceServerGrpc.getRegisterGraphMethod = getRegisterGraphMethod =
|
||||
io.grpc.MethodDescriptor.<nd4j.graph.FlatGraph, nd4j.graph.FlatResponse>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"nd4j.graph.GraphInferenceServer", "RegisterGraph"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatGraph.class, getExtractorOfFlatGraph()))
|
||||
.setResponseMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatResponse.class, getExtractorOfFlatResponse()))
|
||||
.setSchemaDescriptor(null)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getRegisterGraphMethod;
|
||||
}
|
||||
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
@java.lang.Deprecated // Use {@link #getForgetGraphMethod()} instead.
|
||||
public static final io.grpc.MethodDescriptor<nd4j.graph.FlatDropRequest,
|
||||
nd4j.graph.FlatResponse> METHOD_FORGET_GRAPH = getForgetGraphMethod();
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<nd4j.graph.FlatDropRequest,
|
||||
nd4j.graph.FlatResponse> getForgetGraphMethod;
|
||||
|
||||
private static volatile FlatbuffersUtils.FBExtactor<nd4j.graph.FlatDropRequest> extractorOfFlatDropRequest;
|
||||
private static FlatbuffersUtils.FBExtactor<nd4j.graph.FlatDropRequest> getExtractorOfFlatDropRequest() {
|
||||
if (extractorOfFlatDropRequest != null) return extractorOfFlatDropRequest;
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if (extractorOfFlatDropRequest != null) return extractorOfFlatDropRequest;
|
||||
extractorOfFlatDropRequest = new FlatbuffersUtils.FBExtactor<nd4j.graph.FlatDropRequest>() {
|
||||
public nd4j.graph.FlatDropRequest extract (ByteBuffer buffer) {
|
||||
return nd4j.graph.FlatDropRequest.getRootAsFlatDropRequest(buffer);
|
||||
}
|
||||
};
|
||||
return extractorOfFlatDropRequest;
|
||||
}
|
||||
}
|
||||
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
public static io.grpc.MethodDescriptor<nd4j.graph.FlatDropRequest,
|
||||
nd4j.graph.FlatResponse> getForgetGraphMethod() {
|
||||
io.grpc.MethodDescriptor<nd4j.graph.FlatDropRequest, nd4j.graph.FlatResponse> getForgetGraphMethod;
|
||||
if ((getForgetGraphMethod = GraphInferenceServerGrpc.getForgetGraphMethod) == null) {
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if ((getForgetGraphMethod = GraphInferenceServerGrpc.getForgetGraphMethod) == null) {
|
||||
GraphInferenceServerGrpc.getForgetGraphMethod = getForgetGraphMethod =
|
||||
io.grpc.MethodDescriptor.<nd4j.graph.FlatDropRequest, nd4j.graph.FlatResponse>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"nd4j.graph.GraphInferenceServer", "ForgetGraph"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatDropRequest.class, getExtractorOfFlatDropRequest()))
|
||||
.setResponseMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatResponse.class, getExtractorOfFlatResponse()))
|
||||
.setSchemaDescriptor(null)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getForgetGraphMethod;
|
||||
}
|
||||
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
@java.lang.Deprecated // Use {@link #getReplaceGraphMethod()} instead.
|
||||
public static final io.grpc.MethodDescriptor<nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse> METHOD_REPLACE_GRAPH = getReplaceGraphMethod();
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse> getReplaceGraphMethod;
|
||||
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
public static io.grpc.MethodDescriptor<nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse> getReplaceGraphMethod() {
|
||||
io.grpc.MethodDescriptor<nd4j.graph.FlatGraph, nd4j.graph.FlatResponse> getReplaceGraphMethod;
|
||||
if ((getReplaceGraphMethod = GraphInferenceServerGrpc.getReplaceGraphMethod) == null) {
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if ((getReplaceGraphMethod = GraphInferenceServerGrpc.getReplaceGraphMethod) == null) {
|
||||
GraphInferenceServerGrpc.getReplaceGraphMethod = getReplaceGraphMethod =
|
||||
io.grpc.MethodDescriptor.<nd4j.graph.FlatGraph, nd4j.graph.FlatResponse>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"nd4j.graph.GraphInferenceServer", "ReplaceGraph"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatGraph.class, getExtractorOfFlatGraph()))
|
||||
.setResponseMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatResponse.class, getExtractorOfFlatResponse()))
|
||||
.setSchemaDescriptor(null)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getReplaceGraphMethod;
|
||||
}
|
||||
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
@java.lang.Deprecated // Use {@link #getInferenceRequestMethod()} instead.
|
||||
public static final io.grpc.MethodDescriptor<nd4j.graph.FlatInferenceRequest,
|
||||
nd4j.graph.FlatResult> METHOD_INFERENCE_REQUEST = getInferenceRequestMethod();
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<nd4j.graph.FlatInferenceRequest,
|
||||
nd4j.graph.FlatResult> getInferenceRequestMethod;
|
||||
|
||||
private static volatile FlatbuffersUtils.FBExtactor<nd4j.graph.FlatInferenceRequest> extractorOfFlatInferenceRequest;
|
||||
private static FlatbuffersUtils.FBExtactor<nd4j.graph.FlatInferenceRequest> getExtractorOfFlatInferenceRequest() {
|
||||
if (extractorOfFlatInferenceRequest != null) return extractorOfFlatInferenceRequest;
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if (extractorOfFlatInferenceRequest != null) return extractorOfFlatInferenceRequest;
|
||||
extractorOfFlatInferenceRequest = new FlatbuffersUtils.FBExtactor<nd4j.graph.FlatInferenceRequest>() {
|
||||
public nd4j.graph.FlatInferenceRequest extract (ByteBuffer buffer) {
|
||||
return nd4j.graph.FlatInferenceRequest.getRootAsFlatInferenceRequest(buffer);
|
||||
}
|
||||
};
|
||||
return extractorOfFlatInferenceRequest;
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile FlatbuffersUtils.FBExtactor<nd4j.graph.FlatResult> extractorOfFlatResult;
|
||||
private static FlatbuffersUtils.FBExtactor<nd4j.graph.FlatResult> getExtractorOfFlatResult() {
|
||||
if (extractorOfFlatResult != null) return extractorOfFlatResult;
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if (extractorOfFlatResult != null) return extractorOfFlatResult;
|
||||
extractorOfFlatResult = new FlatbuffersUtils.FBExtactor<nd4j.graph.FlatResult>() {
|
||||
public nd4j.graph.FlatResult extract (ByteBuffer buffer) {
|
||||
return nd4j.graph.FlatResult.getRootAsFlatResult(buffer);
|
||||
}
|
||||
};
|
||||
return extractorOfFlatResult;
|
||||
}
|
||||
}
|
||||
|
||||
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
|
||||
public static io.grpc.MethodDescriptor<nd4j.graph.FlatInferenceRequest,
|
||||
nd4j.graph.FlatResult> getInferenceRequestMethod() {
|
||||
io.grpc.MethodDescriptor<nd4j.graph.FlatInferenceRequest, nd4j.graph.FlatResult> getInferenceRequestMethod;
|
||||
if ((getInferenceRequestMethod = GraphInferenceServerGrpc.getInferenceRequestMethod) == null) {
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
if ((getInferenceRequestMethod = GraphInferenceServerGrpc.getInferenceRequestMethod) == null) {
|
||||
GraphInferenceServerGrpc.getInferenceRequestMethod = getInferenceRequestMethod =
|
||||
io.grpc.MethodDescriptor.<nd4j.graph.FlatInferenceRequest, nd4j.graph.FlatResult>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(
|
||||
"nd4j.graph.GraphInferenceServer", "InferenceRequest"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatInferenceRequest.class, getExtractorOfFlatInferenceRequest()))
|
||||
.setResponseMarshaller(FlatbuffersUtils.marshaller(
|
||||
nd4j.graph.FlatResult.class, getExtractorOfFlatResult()))
|
||||
.setSchemaDescriptor(null)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getInferenceRequestMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new async stub that supports all call types for the service
|
||||
*/
|
||||
public static GraphInferenceServerStub newStub(io.grpc.Channel channel) {
|
||||
return new GraphInferenceServerStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||
*/
|
||||
public static GraphInferenceServerBlockingStub newBlockingStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new GraphInferenceServerBlockingStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||
*/
|
||||
public static GraphInferenceServerFutureStub newFutureStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new GraphInferenceServerFutureStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public static abstract class GraphInferenceServerImplBase implements io.grpc.BindableService {
|
||||
|
||||
/**
|
||||
*/
|
||||
public void registerGraph(nd4j.graph.FlatGraph request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getRegisterGraphMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void forgetGraph(nd4j.graph.FlatDropRequest request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getForgetGraphMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void replaceGraph(nd4j.graph.FlatGraph request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getReplaceGraphMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void inferenceRequest(nd4j.graph.FlatInferenceRequest request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResult> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getInferenceRequestMethod(), responseObserver);
|
||||
}
|
||||
|
||||
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||
.addMethod(
|
||||
getRegisterGraphMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse>(
|
||||
this, METHODID_REGISTER_GRAPH)))
|
||||
.addMethod(
|
||||
getForgetGraphMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
nd4j.graph.FlatDropRequest,
|
||||
nd4j.graph.FlatResponse>(
|
||||
this, METHODID_FORGET_GRAPH)))
|
||||
.addMethod(
|
||||
getReplaceGraphMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
nd4j.graph.FlatGraph,
|
||||
nd4j.graph.FlatResponse>(
|
||||
this, METHODID_REPLACE_GRAPH)))
|
||||
.addMethod(
|
||||
getInferenceRequestMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
nd4j.graph.FlatInferenceRequest,
|
||||
nd4j.graph.FlatResult>(
|
||||
this, METHODID_INFERENCE_REQUEST)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public static final class GraphInferenceServerStub extends io.grpc.stub.AbstractStub<GraphInferenceServerStub> {
|
||||
private GraphInferenceServerStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private GraphInferenceServerStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected GraphInferenceServerStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new GraphInferenceServerStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void registerGraph(nd4j.graph.FlatGraph request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getRegisterGraphMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void forgetGraph(nd4j.graph.FlatDropRequest request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getForgetGraphMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void replaceGraph(nd4j.graph.FlatGraph request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getReplaceGraphMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void inferenceRequest(nd4j.graph.FlatInferenceRequest request,
|
||||
io.grpc.stub.StreamObserver<nd4j.graph.FlatResult> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getInferenceRequestMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public static final class GraphInferenceServerBlockingStub extends io.grpc.stub.AbstractStub<GraphInferenceServerBlockingStub> {
|
||||
private GraphInferenceServerBlockingStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private GraphInferenceServerBlockingStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected GraphInferenceServerBlockingStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new GraphInferenceServerBlockingStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public nd4j.graph.FlatResponse registerGraph(nd4j.graph.FlatGraph request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getRegisterGraphMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public nd4j.graph.FlatResponse forgetGraph(nd4j.graph.FlatDropRequest request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getForgetGraphMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public nd4j.graph.FlatResponse replaceGraph(nd4j.graph.FlatGraph request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getReplaceGraphMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public nd4j.graph.FlatResult inferenceRequest(nd4j.graph.FlatInferenceRequest request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getInferenceRequestMethod(), getCallOptions(), request);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public static final class GraphInferenceServerFutureStub extends io.grpc.stub.AbstractStub<GraphInferenceServerFutureStub> {
|
||||
private GraphInferenceServerFutureStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private GraphInferenceServerFutureStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected GraphInferenceServerFutureStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new GraphInferenceServerFutureStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<nd4j.graph.FlatResponse> registerGraph(
|
||||
nd4j.graph.FlatGraph request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getRegisterGraphMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<nd4j.graph.FlatResponse> forgetGraph(
|
||||
nd4j.graph.FlatDropRequest request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getForgetGraphMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<nd4j.graph.FlatResponse> replaceGraph(
|
||||
nd4j.graph.FlatGraph request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getReplaceGraphMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<nd4j.graph.FlatResult> inferenceRequest(
|
||||
nd4j.graph.FlatInferenceRequest request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getInferenceRequestMethod(), getCallOptions()), request);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int METHODID_REGISTER_GRAPH = 0;
|
||||
private static final int METHODID_FORGET_GRAPH = 1;
|
||||
private static final int METHODID_REPLACE_GRAPH = 2;
|
||||
private static final int METHODID_INFERENCE_REQUEST = 3;
|
||||
|
||||
private static final class MethodHandlers<Req, Resp> implements
|
||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||
private final GraphInferenceServerImplBase serviceImpl;
|
||||
private final int methodId;
|
||||
|
||||
MethodHandlers(GraphInferenceServerImplBase serviceImpl, int methodId) {
|
||||
this.serviceImpl = serviceImpl;
|
||||
this.methodId = methodId;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
case METHODID_REGISTER_GRAPH:
|
||||
serviceImpl.registerGraph((nd4j.graph.FlatGraph) request,
|
||||
(io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse>) responseObserver);
|
||||
break;
|
||||
case METHODID_FORGET_GRAPH:
|
||||
serviceImpl.forgetGraph((nd4j.graph.FlatDropRequest) request,
|
||||
(io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse>) responseObserver);
|
||||
break;
|
||||
case METHODID_REPLACE_GRAPH:
|
||||
serviceImpl.replaceGraph((nd4j.graph.FlatGraph) request,
|
||||
(io.grpc.stub.StreamObserver<nd4j.graph.FlatResponse>) responseObserver);
|
||||
break;
|
||||
case METHODID_INFERENCE_REQUEST:
|
||||
serviceImpl.inferenceRequest((nd4j.graph.FlatInferenceRequest) request,
|
||||
(io.grpc.stub.StreamObserver<nd4j.graph.FlatResult>) responseObserver);
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (GraphInferenceServerGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||
.setSchemaDescriptor(null)
|
||||
.addMethod(getRegisterGraphMethod())
|
||||
.addMethod(getForgetGraphMethod())
|
||||
.addMethod(getReplaceGraphMethod())
|
||||
.addMethod(getInferenceRequestMethod())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum InputType : sbyte
|
||||
{
|
||||
UNDEFINED = 0,
|
||||
NUMERIC = 1,
|
||||
STRINGULAR = 2,
|
||||
NUMERIC_SET = 3,
|
||||
STRINGULAR_SET = 4,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class InputType {
|
||||
private InputType() { }
|
||||
public static final byte UNDEFINED = 0;
|
||||
public static final byte NUMERIC = 1;
|
||||
public static final byte STRINGULAR = 2;
|
||||
public static final byte NUMERIC_SET = 3;
|
||||
public static final byte STRINGULAR_SET = 4;
|
||||
|
||||
public static final String[] names = { "UNDEFINED", "NUMERIC", "STRINGULAR", "NUMERIC_SET", "STRINGULAR_SET", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class InputType(object):
|
||||
UNDEFINED = 0
|
||||
NUMERIC = 1
|
||||
STRINGULAR = 2
|
||||
NUMERIC_SET = 3
|
||||
STRINGULAR_SET = 4
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct IntPair : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static IntPair GetRootAsIntPair(ByteBuffer _bb) { return GetRootAsIntPair(_bb, new IntPair()); }
|
||||
public static IntPair GetRootAsIntPair(ByteBuffer _bb, IntPair obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public IntPair __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int First { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public int Second { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
|
||||
public static Offset<IntPair> CreateIntPair(FlatBufferBuilder builder,
|
||||
int first = 0,
|
||||
int second = 0) {
|
||||
builder.StartObject(2);
|
||||
IntPair.AddSecond(builder, second);
|
||||
IntPair.AddFirst(builder, first);
|
||||
return IntPair.EndIntPair(builder);
|
||||
}
|
||||
|
||||
public static void StartIntPair(FlatBufferBuilder builder) { builder.StartObject(2); }
|
||||
public static void AddFirst(FlatBufferBuilder builder, int first) { builder.AddInt(0, first, 0); }
|
||||
public static void AddSecond(FlatBufferBuilder builder, int second) { builder.AddInt(1, second, 0); }
|
||||
public static Offset<IntPair> EndIntPair(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<IntPair>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class IntPair extends Table {
|
||||
public static IntPair getRootAsIntPair(ByteBuffer _bb) { return getRootAsIntPair(_bb, new IntPair()); }
|
||||
public static IntPair getRootAsIntPair(ByteBuffer _bb, IntPair obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public IntPair __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int first() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public int second() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
|
||||
public static int createIntPair(FlatBufferBuilder builder,
|
||||
int first,
|
||||
int second) {
|
||||
builder.startObject(2);
|
||||
IntPair.addSecond(builder, second);
|
||||
IntPair.addFirst(builder, first);
|
||||
return IntPair.endIntPair(builder);
|
||||
}
|
||||
|
||||
public static void startIntPair(FlatBufferBuilder builder) { builder.startObject(2); }
|
||||
public static void addFirst(FlatBufferBuilder builder, int first) { builder.addInt(0, first, 0); }
|
||||
public static void addSecond(FlatBufferBuilder builder, int second) { builder.addInt(1, second, 0); }
|
||||
public static int endIntPair(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class IntPair(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsIntPair(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = IntPair()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# IntPair
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# IntPair
|
||||
def First(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# IntPair
|
||||
def Second(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def IntPairStart(builder): builder.StartObject(2)
|
||||
def IntPairAddFirst(builder, first): builder.PrependInt32Slot(0, first, 0)
|
||||
def IntPairAddSecond(builder, second): builder.PrependInt32Slot(1, second, 0)
|
||||
def IntPairEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,46 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct IntTriple : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static IntTriple GetRootAsIntTriple(ByteBuffer _bb) { return GetRootAsIntTriple(_bb, new IntTriple()); }
|
||||
public static IntTriple GetRootAsIntTriple(ByteBuffer _bb, IntTriple obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public IntTriple __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int First { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public int Second { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public int Third { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
|
||||
public static Offset<IntTriple> CreateIntTriple(FlatBufferBuilder builder,
|
||||
int first = 0,
|
||||
int second = 0,
|
||||
int third = 0) {
|
||||
builder.StartObject(3);
|
||||
IntTriple.AddThird(builder, third);
|
||||
IntTriple.AddSecond(builder, second);
|
||||
IntTriple.AddFirst(builder, first);
|
||||
return IntTriple.EndIntTriple(builder);
|
||||
}
|
||||
|
||||
public static void StartIntTriple(FlatBufferBuilder builder) { builder.StartObject(3); }
|
||||
public static void AddFirst(FlatBufferBuilder builder, int first) { builder.AddInt(0, first, 0); }
|
||||
public static void AddSecond(FlatBufferBuilder builder, int second) { builder.AddInt(1, second, 0); }
|
||||
public static void AddThird(FlatBufferBuilder builder, int third) { builder.AddInt(2, third, 0); }
|
||||
public static Offset<IntTriple> EndIntTriple(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<IntTriple>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class IntTriple extends Table {
|
||||
public static IntTriple getRootAsIntTriple(ByteBuffer _bb) { return getRootAsIntTriple(_bb, new IntTriple()); }
|
||||
public static IntTriple getRootAsIntTriple(ByteBuffer _bb, IntTriple obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public IntTriple __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int first() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public int second() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public int third() { int o = __offset(8); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
|
||||
public static int createIntTriple(FlatBufferBuilder builder,
|
||||
int first,
|
||||
int second,
|
||||
int third) {
|
||||
builder.startObject(3);
|
||||
IntTriple.addThird(builder, third);
|
||||
IntTriple.addSecond(builder, second);
|
||||
IntTriple.addFirst(builder, first);
|
||||
return IntTriple.endIntTriple(builder);
|
||||
}
|
||||
|
||||
public static void startIntTriple(FlatBufferBuilder builder) { builder.startObject(3); }
|
||||
public static void addFirst(FlatBufferBuilder builder, int first) { builder.addInt(0, first, 0); }
|
||||
public static void addSecond(FlatBufferBuilder builder, int second) { builder.addInt(1, second, 0); }
|
||||
public static void addThird(FlatBufferBuilder builder, int third) { builder.addInt(2, third, 0); }
|
||||
public static int endIntTriple(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class IntTriple(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsIntTriple(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = IntTriple()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# IntTriple
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# IntTriple
|
||||
def First(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# IntTriple
|
||||
def Second(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# IntTriple
|
||||
def Third(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def IntTripleStart(builder): builder.StartObject(3)
|
||||
def IntTripleAddFirst(builder, first): builder.PrependInt32Slot(0, first, 0)
|
||||
def IntTripleAddSecond(builder, second): builder.PrependInt32Slot(1, second, 0)
|
||||
def IntTripleAddThird(builder, third): builder.PrependInt32Slot(2, third, 0)
|
||||
def IntTripleEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,42 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct LongPair : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static LongPair GetRootAsLongPair(ByteBuffer _bb) { return GetRootAsLongPair(_bb, new LongPair()); }
|
||||
public static LongPair GetRootAsLongPair(ByteBuffer _bb, LongPair obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public LongPair __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long First { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public long Second { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
|
||||
public static Offset<LongPair> CreateLongPair(FlatBufferBuilder builder,
|
||||
long first = 0,
|
||||
long second = 0) {
|
||||
builder.StartObject(2);
|
||||
LongPair.AddSecond(builder, second);
|
||||
LongPair.AddFirst(builder, first);
|
||||
return LongPair.EndLongPair(builder);
|
||||
}
|
||||
|
||||
public static void StartLongPair(FlatBufferBuilder builder) { builder.StartObject(2); }
|
||||
public static void AddFirst(FlatBufferBuilder builder, long first) { builder.AddLong(0, first, 0); }
|
||||
public static void AddSecond(FlatBufferBuilder builder, long second) { builder.AddLong(1, second, 0); }
|
||||
public static Offset<LongPair> EndLongPair(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<LongPair>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class LongPair extends Table {
|
||||
public static LongPair getRootAsLongPair(ByteBuffer _bb) { return getRootAsLongPair(_bb, new LongPair()); }
|
||||
public static LongPair getRootAsLongPair(ByteBuffer _bb, LongPair obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public LongPair __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long first() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public long second() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
|
||||
public static int createLongPair(FlatBufferBuilder builder,
|
||||
long first,
|
||||
long second) {
|
||||
builder.startObject(2);
|
||||
LongPair.addSecond(builder, second);
|
||||
LongPair.addFirst(builder, first);
|
||||
return LongPair.endLongPair(builder);
|
||||
}
|
||||
|
||||
public static void startLongPair(FlatBufferBuilder builder) { builder.startObject(2); }
|
||||
public static void addFirst(FlatBufferBuilder builder, long first) { builder.addLong(0, first, 0L); }
|
||||
public static void addSecond(FlatBufferBuilder builder, long second) { builder.addLong(1, second, 0L); }
|
||||
public static int endLongPair(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class LongPair(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsLongPair(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = LongPair()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# LongPair
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# LongPair
|
||||
def First(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# LongPair
|
||||
def Second(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def LongPairStart(builder): builder.StartObject(2)
|
||||
def LongPairAddFirst(builder, first): builder.PrependInt64Slot(0, first, 0)
|
||||
def LongPairAddSecond(builder, second): builder.PrependInt64Slot(1, second, 0)
|
||||
def LongPairEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,46 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct LongTriple : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static LongTriple GetRootAsLongTriple(ByteBuffer _bb) { return GetRootAsLongTriple(_bb, new LongTriple()); }
|
||||
public static LongTriple GetRootAsLongTriple(ByteBuffer _bb, LongTriple obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public LongTriple __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long First { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public long Second { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public long Third { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
|
||||
public static Offset<LongTriple> CreateLongTriple(FlatBufferBuilder builder,
|
||||
long first = 0,
|
||||
long second = 0,
|
||||
long third = 0) {
|
||||
builder.StartObject(3);
|
||||
LongTriple.AddThird(builder, third);
|
||||
LongTriple.AddSecond(builder, second);
|
||||
LongTriple.AddFirst(builder, first);
|
||||
return LongTriple.EndLongTriple(builder);
|
||||
}
|
||||
|
||||
public static void StartLongTriple(FlatBufferBuilder builder) { builder.StartObject(3); }
|
||||
public static void AddFirst(FlatBufferBuilder builder, long first) { builder.AddLong(0, first, 0); }
|
||||
public static void AddSecond(FlatBufferBuilder builder, long second) { builder.AddLong(1, second, 0); }
|
||||
public static void AddThird(FlatBufferBuilder builder, long third) { builder.AddLong(2, third, 0); }
|
||||
public static Offset<LongTriple> EndLongTriple(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<LongTriple>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class LongTriple extends Table {
|
||||
public static LongTriple getRootAsLongTriple(ByteBuffer _bb) { return getRootAsLongTriple(_bb, new LongTriple()); }
|
||||
public static LongTriple getRootAsLongTriple(ByteBuffer _bb, LongTriple obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public LongTriple __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public long first() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public long second() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public long third() { int o = __offset(8); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
|
||||
public static int createLongTriple(FlatBufferBuilder builder,
|
||||
long first,
|
||||
long second,
|
||||
long third) {
|
||||
builder.startObject(3);
|
||||
LongTriple.addThird(builder, third);
|
||||
LongTriple.addSecond(builder, second);
|
||||
LongTriple.addFirst(builder, first);
|
||||
return LongTriple.endLongTriple(builder);
|
||||
}
|
||||
|
||||
public static void startLongTriple(FlatBufferBuilder builder) { builder.startObject(3); }
|
||||
public static void addFirst(FlatBufferBuilder builder, long first) { builder.addLong(0, first, 0L); }
|
||||
public static void addSecond(FlatBufferBuilder builder, long second) { builder.addLong(1, second, 0L); }
|
||||
public static void addThird(FlatBufferBuilder builder, long third) { builder.addLong(2, third, 0L); }
|
||||
public static int endLongTriple(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class LongTriple(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsLongTriple(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = LongTriple()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# LongTriple
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# LongTriple
|
||||
def First(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# LongTriple
|
||||
def Second(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# LongTriple
|
||||
def Third(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def LongTripleStart(builder): builder.StartObject(3)
|
||||
def LongTripleAddFirst(builder, first): builder.PrependInt64Slot(0, first, 0)
|
||||
def LongTripleAddSecond(builder, second): builder.PrependInt64Slot(1, second, 0)
|
||||
def LongTripleAddThird(builder, third): builder.PrependInt64Slot(2, third, 0)
|
||||
def LongTripleEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,19 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum OpClass : sbyte
|
||||
{
|
||||
TRANSFORM = 0,
|
||||
REDUCTION = 1,
|
||||
MULTIPLICATOR = 2,
|
||||
GRAPH = 3,
|
||||
CONDITIONAL = 4,
|
||||
LOOP = 5,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class OpClass {
|
||||
private OpClass() { }
|
||||
public static final byte TRANSFORM = 0;
|
||||
public static final byte REDUCTION = 1;
|
||||
public static final byte MULTIPLICATOR = 2;
|
||||
public static final byte GRAPH = 3;
|
||||
public static final byte CONDITIONAL = 4;
|
||||
public static final byte LOOP = 5;
|
||||
|
||||
public static final String[] names = { "TRANSFORM", "REDUCTION", "MULTIPLICATOR", "GRAPH", "CONDITIONAL", "LOOP", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class OpClass(object):
|
||||
TRANSFORM = 0
|
||||
REDUCTION = 1
|
||||
MULTIPLICATOR = 2
|
||||
GRAPH = 3
|
||||
CONDITIONAL = 4
|
||||
LOOP = 5
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum OpType : sbyte
|
||||
{
|
||||
TRANSFORM_FLOAT = 0,
|
||||
TRANSFORM_SAME = 1,
|
||||
TRANSFORM_BOOL = 2,
|
||||
TRANSFORM_STRICT = 3,
|
||||
TRANSFORM_ANY = 4,
|
||||
REDUCE_FLOAT = 5,
|
||||
REDUCE_SAME = 6,
|
||||
REDUCE_LONG = 7,
|
||||
REDUCE_BOOL = 8,
|
||||
INDEX_REDUCE = 9,
|
||||
SCALAR = 10,
|
||||
SCALAR_BOOL = 11,
|
||||
BROADCAST = 12,
|
||||
BROADCAST_BOOL = 13,
|
||||
PAIRWISE = 14,
|
||||
PAIRWISE_BOOL = 15,
|
||||
REDUCE_3 = 16,
|
||||
SUMMARYSTATS = 17,
|
||||
SHAPE = 18,
|
||||
AGGREGATION = 19,
|
||||
RANDOM = 20,
|
||||
CUSTOM = 21,
|
||||
GRAPH = 22,
|
||||
VARIABLE = 40,
|
||||
BOOLEAN = 60,
|
||||
LOGIC = 119,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class OpType {
|
||||
private OpType() { }
|
||||
public static final byte TRANSFORM_FLOAT = 0;
|
||||
public static final byte TRANSFORM_SAME = 1;
|
||||
public static final byte TRANSFORM_BOOL = 2;
|
||||
public static final byte TRANSFORM_STRICT = 3;
|
||||
public static final byte TRANSFORM_ANY = 4;
|
||||
public static final byte REDUCE_FLOAT = 5;
|
||||
public static final byte REDUCE_SAME = 6;
|
||||
public static final byte REDUCE_LONG = 7;
|
||||
public static final byte REDUCE_BOOL = 8;
|
||||
public static final byte INDEX_REDUCE = 9;
|
||||
public static final byte SCALAR = 10;
|
||||
public static final byte SCALAR_BOOL = 11;
|
||||
public static final byte BROADCAST = 12;
|
||||
public static final byte BROADCAST_BOOL = 13;
|
||||
public static final byte PAIRWISE = 14;
|
||||
public static final byte PAIRWISE_BOOL = 15;
|
||||
public static final byte REDUCE_3 = 16;
|
||||
public static final byte SUMMARYSTATS = 17;
|
||||
public static final byte SHAPE = 18;
|
||||
public static final byte AGGREGATION = 19;
|
||||
public static final byte RANDOM = 20;
|
||||
public static final byte CUSTOM = 21;
|
||||
public static final byte GRAPH = 22;
|
||||
public static final byte VARIABLE = 40;
|
||||
public static final byte BOOLEAN = 60;
|
||||
public static final byte LOGIC = 119;
|
||||
|
||||
public static final String[] names = { "TRANSFORM_FLOAT", "TRANSFORM_SAME", "TRANSFORM_BOOL", "TRANSFORM_STRICT", "TRANSFORM_ANY", "REDUCE_FLOAT", "REDUCE_SAME", "REDUCE_LONG", "REDUCE_BOOL", "INDEX_REDUCE", "SCALAR", "SCALAR_BOOL", "BROADCAST", "BROADCAST_BOOL", "PAIRWISE", "PAIRWISE_BOOL", "REDUCE_3", "SUMMARYSTATS", "SHAPE", "AGGREGATION", "RANDOM", "CUSTOM", "GRAPH", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "VARIABLE", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "BOOLEAN", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "LOGIC", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class OpType(object):
|
||||
TRANSFORM_FLOAT = 0
|
||||
TRANSFORM_SAME = 1
|
||||
TRANSFORM_BOOL = 2
|
||||
TRANSFORM_STRICT = 3
|
||||
TRANSFORM_ANY = 4
|
||||
REDUCE_FLOAT = 5
|
||||
REDUCE_SAME = 6
|
||||
REDUCE_LONG = 7
|
||||
REDUCE_BOOL = 8
|
||||
INDEX_REDUCE = 9
|
||||
SCALAR = 10
|
||||
SCALAR_BOOL = 11
|
||||
BROADCAST = 12
|
||||
BROADCAST_BOOL = 13
|
||||
PAIRWISE = 14
|
||||
PAIRWISE_BOOL = 15
|
||||
REDUCE_3 = 16
|
||||
SUMMARYSTATS = 17
|
||||
SHAPE = 18
|
||||
AGGREGATION = 19
|
||||
RANDOM = 20
|
||||
CUSTOM = 21
|
||||
GRAPH = 22
|
||||
VARIABLE = 40
|
||||
BOOLEAN = 60
|
||||
LOGIC = 119
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum OutputMode : sbyte
|
||||
{
|
||||
IMPLICIT = 0,
|
||||
EXPLICIT = 1,
|
||||
EXPLICIT_AND_IMPLICIT = 2,
|
||||
VARIABLE_SPACE = 3,
|
||||
OPTIMIZED = 4,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class OutputMode {
|
||||
private OutputMode() { }
|
||||
public static final byte IMPLICIT = 0;
|
||||
public static final byte EXPLICIT = 1;
|
||||
public static final byte EXPLICIT_AND_IMPLICIT = 2;
|
||||
public static final byte VARIABLE_SPACE = 3;
|
||||
public static final byte OPTIMIZED = 4;
|
||||
|
||||
public static final String[] names = { "IMPLICIT", "EXPLICIT", "EXPLICIT_AND_IMPLICIT", "VARIABLE_SPACE", "OPTIMIZED", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class OutputMode(object):
|
||||
IMPLICIT = 0
|
||||
EXPLICIT = 1
|
||||
EXPLICIT_AND_IMPLICIT = 2
|
||||
VARIABLE_SPACE = 3
|
||||
OPTIMIZED = 4
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum ProfilingMode : sbyte
|
||||
{
|
||||
NONE = 0,
|
||||
NAN_PANIC = 1,
|
||||
INF_PANIC = 2,
|
||||
ANY_PANIC = 3,
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
public final class ProfilingMode {
|
||||
private ProfilingMode() { }
|
||||
public static final byte NONE = 0;
|
||||
public static final byte NAN_PANIC = 1;
|
||||
public static final byte INF_PANIC = 2;
|
||||
public static final byte ANY_PANIC = 3;
|
||||
|
||||
public static final String[] names = { "NONE", "NAN_PANIC", "INF_PANIC", "ANY_PANIC", };
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
class ProfilingMode(object):
|
||||
NONE = 0
|
||||
NAN_PANIC = 1
|
||||
INF_PANIC = 2
|
||||
ANY_PANIC = 3
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct UIAddName : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static UIAddName GetRootAsUIAddName(ByteBuffer _bb) { return GetRootAsUIAddName(_bb, new UIAddName()); }
|
||||
public static UIAddName GetRootAsUIAddName(ByteBuffer _bb, UIAddName obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public UIAddName __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int NameIdx { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public string Name { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetNameBytes() { return __p.__vector_as_span(6); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetNameBytes() { return __p.__vector_as_arraysegment(6); }
|
||||
#endif
|
||||
public byte[] GetNameArray() { return __p.__vector_as_array<byte>(6); }
|
||||
|
||||
public static Offset<UIAddName> CreateUIAddName(FlatBufferBuilder builder,
|
||||
int nameIdx = 0,
|
||||
StringOffset nameOffset = default(StringOffset)) {
|
||||
builder.StartObject(2);
|
||||
UIAddName.AddName(builder, nameOffset);
|
||||
UIAddName.AddNameIdx(builder, nameIdx);
|
||||
return UIAddName.EndUIAddName(builder);
|
||||
}
|
||||
|
||||
public static void StartUIAddName(FlatBufferBuilder builder) { builder.StartObject(2); }
|
||||
public static void AddNameIdx(FlatBufferBuilder builder, int nameIdx) { builder.AddInt(0, nameIdx, 0); }
|
||||
public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(1, nameOffset.Value, 0); }
|
||||
public static Offset<UIAddName> EndUIAddName(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<UIAddName>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class UIAddName extends Table {
|
||||
public static UIAddName getRootAsUIAddName(ByteBuffer _bb) { return getRootAsUIAddName(_bb, new UIAddName()); }
|
||||
public static UIAddName getRootAsUIAddName(ByteBuffer _bb, UIAddName obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public UIAddName __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int nameIdx() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public String name() { int o = __offset(6); return o != 0 ? __string(o + bb_pos) : null; }
|
||||
public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
|
||||
public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }
|
||||
|
||||
public static int createUIAddName(FlatBufferBuilder builder,
|
||||
int nameIdx,
|
||||
int nameOffset) {
|
||||
builder.startObject(2);
|
||||
UIAddName.addName(builder, nameOffset);
|
||||
UIAddName.addNameIdx(builder, nameIdx);
|
||||
return UIAddName.endUIAddName(builder);
|
||||
}
|
||||
|
||||
public static void startUIAddName(FlatBufferBuilder builder) { builder.startObject(2); }
|
||||
public static void addNameIdx(FlatBufferBuilder builder, int nameIdx) { builder.addInt(0, nameIdx, 0); }
|
||||
public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(1, nameOffset, 0); }
|
||||
public static int endUIAddName(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class UIAddName(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsUIAddName(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = UIAddName()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# UIAddName
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# UIAddName
|
||||
def NameIdx(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIAddName
|
||||
def Name(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.String(o + self._tab.Pos)
|
||||
return None
|
||||
|
||||
def UIAddNameStart(builder): builder.StartObject(2)
|
||||
def UIAddNameAddNameIdx(builder, nameIdx): builder.PrependInt32Slot(0, nameIdx, 0)
|
||||
def UIAddNameAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
|
||||
def UIAddNameEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,70 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct UIEvent : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static UIEvent GetRootAsUIEvent(ByteBuffer _bb) { return GetRootAsUIEvent(_bb, new UIEvent()); }
|
||||
public static UIEvent GetRootAsUIEvent(ByteBuffer _bb, UIEvent obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public UIEvent __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public UIEventType EventType { get { int o = __p.__offset(4); return o != 0 ? (UIEventType)__p.bb.GetSbyte(o + __p.bb_pos) : UIEventType.ADD_NAME; } }
|
||||
public UIEventSubtype EventSubType { get { int o = __p.__offset(6); return o != 0 ? (UIEventSubtype)__p.bb.GetSbyte(o + __p.bb_pos) : UIEventSubtype.NONE; } }
|
||||
public int NameIdx { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public long Timestamp { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
|
||||
public int Iteration { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public int Epoch { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
public short VariableId { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetShort(o + __p.bb_pos) : (short)0; } }
|
||||
public FrameIteration? FrameIter { get { int o = __p.__offset(18); return o != 0 ? (FrameIteration?)(new FrameIteration()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
|
||||
public ushort Plugin { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
|
||||
|
||||
public static Offset<UIEvent> CreateUIEvent(FlatBufferBuilder builder,
|
||||
UIEventType eventType = UIEventType.ADD_NAME,
|
||||
UIEventSubtype eventSubType = UIEventSubtype.NONE,
|
||||
int nameIdx = 0,
|
||||
long timestamp = 0,
|
||||
int iteration = 0,
|
||||
int epoch = 0,
|
||||
short variableId = 0,
|
||||
Offset<FrameIteration> frameIterOffset = default(Offset<FrameIteration>),
|
||||
ushort plugin = 0) {
|
||||
builder.StartObject(9);
|
||||
UIEvent.AddTimestamp(builder, timestamp);
|
||||
UIEvent.AddFrameIter(builder, frameIterOffset);
|
||||
UIEvent.AddEpoch(builder, epoch);
|
||||
UIEvent.AddIteration(builder, iteration);
|
||||
UIEvent.AddNameIdx(builder, nameIdx);
|
||||
UIEvent.AddPlugin(builder, plugin);
|
||||
UIEvent.AddVariableId(builder, variableId);
|
||||
UIEvent.AddEventSubType(builder, eventSubType);
|
||||
UIEvent.AddEventType(builder, eventType);
|
||||
return UIEvent.EndUIEvent(builder);
|
||||
}
|
||||
|
||||
public static void StartUIEvent(FlatBufferBuilder builder) { builder.StartObject(9); }
|
||||
public static void AddEventType(FlatBufferBuilder builder, UIEventType eventType) { builder.AddSbyte(0, (sbyte)eventType, 0); }
|
||||
public static void AddEventSubType(FlatBufferBuilder builder, UIEventSubtype eventSubType) { builder.AddSbyte(1, (sbyte)eventSubType, 0); }
|
||||
public static void AddNameIdx(FlatBufferBuilder builder, int nameIdx) { builder.AddInt(2, nameIdx, 0); }
|
||||
public static void AddTimestamp(FlatBufferBuilder builder, long timestamp) { builder.AddLong(3, timestamp, 0); }
|
||||
public static void AddIteration(FlatBufferBuilder builder, int iteration) { builder.AddInt(4, iteration, 0); }
|
||||
public static void AddEpoch(FlatBufferBuilder builder, int epoch) { builder.AddInt(5, epoch, 0); }
|
||||
public static void AddVariableId(FlatBufferBuilder builder, short variableId) { builder.AddShort(6, variableId, 0); }
|
||||
public static void AddFrameIter(FlatBufferBuilder builder, Offset<FrameIteration> frameIterOffset) { builder.AddOffset(7, frameIterOffset.Value, 0); }
|
||||
public static void AddPlugin(FlatBufferBuilder builder, ushort plugin) { builder.AddUshort(8, plugin, 0); }
|
||||
public static Offset<UIEvent> EndUIEvent(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<UIEvent>(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
package nd4j.graph;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class UIEvent extends Table {
|
||||
public static UIEvent getRootAsUIEvent(ByteBuffer _bb) { return getRootAsUIEvent(_bb, new UIEvent()); }
|
||||
public static UIEvent getRootAsUIEvent(ByteBuffer _bb, UIEvent obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
|
||||
public UIEvent __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public byte eventType() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public byte eventSubType() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public int nameIdx() { int o = __offset(8); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public long timestamp() { int o = __offset(10); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
|
||||
public int iteration() { int o = __offset(12); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public int epoch() { int o = __offset(14); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public short variableId() { int o = __offset(16); return o != 0 ? bb.getShort(o + bb_pos) : 0; }
|
||||
public FrameIteration frameIter() { return frameIter(new FrameIteration()); }
|
||||
public FrameIteration frameIter(FrameIteration obj) { int o = __offset(18); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public int plugin() { int o = __offset(20); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
|
||||
|
||||
public static int createUIEvent(FlatBufferBuilder builder,
|
||||
byte eventType,
|
||||
byte eventSubType,
|
||||
int nameIdx,
|
||||
long timestamp,
|
||||
int iteration,
|
||||
int epoch,
|
||||
short variableId,
|
||||
int frameIterOffset,
|
||||
int plugin) {
|
||||
builder.startObject(9);
|
||||
UIEvent.addTimestamp(builder, timestamp);
|
||||
UIEvent.addFrameIter(builder, frameIterOffset);
|
||||
UIEvent.addEpoch(builder, epoch);
|
||||
UIEvent.addIteration(builder, iteration);
|
||||
UIEvent.addNameIdx(builder, nameIdx);
|
||||
UIEvent.addPlugin(builder, plugin);
|
||||
UIEvent.addVariableId(builder, variableId);
|
||||
UIEvent.addEventSubType(builder, eventSubType);
|
||||
UIEvent.addEventType(builder, eventType);
|
||||
return UIEvent.endUIEvent(builder);
|
||||
}
|
||||
|
||||
public static void startUIEvent(FlatBufferBuilder builder) { builder.startObject(9); }
|
||||
public static void addEventType(FlatBufferBuilder builder, byte eventType) { builder.addByte(0, eventType, 0); }
|
||||
public static void addEventSubType(FlatBufferBuilder builder, byte eventSubType) { builder.addByte(1, eventSubType, 0); }
|
||||
public static void addNameIdx(FlatBufferBuilder builder, int nameIdx) { builder.addInt(2, nameIdx, 0); }
|
||||
public static void addTimestamp(FlatBufferBuilder builder, long timestamp) { builder.addLong(3, timestamp, 0L); }
|
||||
public static void addIteration(FlatBufferBuilder builder, int iteration) { builder.addInt(4, iteration, 0); }
|
||||
public static void addEpoch(FlatBufferBuilder builder, int epoch) { builder.addInt(5, epoch, 0); }
|
||||
public static void addVariableId(FlatBufferBuilder builder, short variableId) { builder.addShort(6, variableId, 0); }
|
||||
public static void addFrameIter(FlatBufferBuilder builder, int frameIterOffset) { builder.addOffset(7, frameIterOffset, 0); }
|
||||
public static void addPlugin(FlatBufferBuilder builder, int plugin) { builder.addShort(8, (short)plugin, (short)0); }
|
||||
public static int endUIEvent(FlatBufferBuilder builder) {
|
||||
int o = builder.endObject();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
# /* ******************************************************************************
|
||||
# *
|
||||
# *
|
||||
# * This program and the accompanying materials are made available under the
|
||||
# * terms of the Apache License, Version 2.0 which is available at
|
||||
# * https://www.apache.org/licenses/LICENSE-2.0.
|
||||
# *
|
||||
# * See the NOTICE file distributed with this work for additional
|
||||
# * information regarding copyright ownership.
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# * License for the specific language governing permissions and limitations
|
||||
# * under the License.
|
||||
# *
|
||||
# * SPDX-License-Identifier: Apache-2.0
|
||||
# ******************************************************************************/
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class UIEvent(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAsUIEvent(cls, buf, offset):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = UIEvent()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
# UIEvent
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# UIEvent
|
||||
def EventType(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIEvent
|
||||
def EventSubType(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIEvent
|
||||
def NameIdx(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIEvent
|
||||
def Timestamp(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIEvent
|
||||
def Iteration(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIEvent
|
||||
def Epoch(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIEvent
|
||||
def VariableId(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# UIEvent
|
||||
def FrameIter(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .FrameIteration import FrameIteration
|
||||
obj = FrameIteration()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# UIEvent
|
||||
def Plugin(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def UIEventStart(builder): builder.StartObject(9)
|
||||
def UIEventAddEventType(builder, eventType): builder.PrependInt8Slot(0, eventType, 0)
|
||||
def UIEventAddEventSubType(builder, eventSubType): builder.PrependInt8Slot(1, eventSubType, 0)
|
||||
def UIEventAddNameIdx(builder, nameIdx): builder.PrependInt32Slot(2, nameIdx, 0)
|
||||
def UIEventAddTimestamp(builder, timestamp): builder.PrependInt64Slot(3, timestamp, 0)
|
||||
def UIEventAddIteration(builder, iteration): builder.PrependInt32Slot(4, iteration, 0)
|
||||
def UIEventAddEpoch(builder, epoch): builder.PrependInt32Slot(5, epoch, 0)
|
||||
def UIEventAddVariableId(builder, variableId): builder.PrependInt16Slot(6, variableId, 0)
|
||||
def UIEventAddFrameIter(builder, frameIter): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(frameIter), 0)
|
||||
def UIEventAddPlugin(builder, plugin): builder.PrependUint16Slot(8, plugin, 0)
|
||||
def UIEventEnd(builder): return builder.EndObject()
|
|
@ -0,0 +1,23 @@
|
|||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
namespace sd.graph
|
||||
{
|
||||
|
||||
public enum UIEventSubtype : sbyte
|
||||
{
|
||||
NONE = 0,
|
||||
EVALUATION = 1,
|
||||
LOSS = 2,
|
||||
LEARNING_RATE = 3,
|
||||
TUNING_METRIC = 4,
|
||||
PERFORMANCE = 5,
|
||||
PROFILING = 6,
|
||||
FEATURE_LABEL = 7,
|
||||
PREDICTION = 8,
|
||||
USER_CUSTOM = 9,
|
||||
};
|
||||
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue