cavis/libnd4j/include/graph/generated/request_generated.js

174 lines
4.8 KiB
JavaScript
Raw Normal View History

2021-02-01 06:31:20 +01:00
/*
* ******************************************************************************
* *
* *
* * 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.
* *
2021-02-01 09:47:29 +01:00
* * See the NOTICE file distributed with this work for additional
* * information regarding copyright ownership.
2021-02-01 06:31:20 +01:00
* * 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
* *****************************************************************************
*/
2019-06-06 14:21:15 +02:00
/**
* @const
* @namespace
*/
var nd4j = nd4j || {};
/**
* @const
* @namespace
*/
nd4j.graph = nd4j.graph || {};
/**
* @constructor
*/
nd4j.graph.FlatInferenceRequest = function() {
/**
* @type {flatbuffers.ByteBuffer}
*/
this.bb = null;
/**
* @type {number}
*/
this.bb_pos = 0;
};
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {nd4j.graph.FlatInferenceRequest}
*/
nd4j.graph.FlatInferenceRequest.prototype.__init = function(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
};
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {nd4j.graph.FlatInferenceRequest=} obj
* @returns {nd4j.graph.FlatInferenceRequest}
*/
nd4j.graph.FlatInferenceRequest.getRootAsFlatInferenceRequest = function(bb, obj) {
return (obj || new nd4j.graph.FlatInferenceRequest).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};
/**
* @returns {flatbuffers.Long}
*/
nd4j.graph.FlatInferenceRequest.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.FlatInferenceRequest.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.FlatInferenceRequest.prototype.variablesLength = function() {
var offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};
/**
* @param {nd4j.graph.FlatConfiguration=} obj
* @returns {nd4j.graph.FlatConfiguration|null}
*/
nd4j.graph.FlatInferenceRequest.prototype.configuration = function(obj) {
var offset = this.bb.__offset(this.bb_pos, 8);
return offset ? (obj || new nd4j.graph.FlatConfiguration).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};
/**
* @param {flatbuffers.Builder} builder
*/
nd4j.graph.FlatInferenceRequest.startFlatInferenceRequest = function(builder) {
builder.startObject(3);
};
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} id
*/
nd4j.graph.FlatInferenceRequest.addId = function(builder, id) {
builder.addFieldInt64(0, id, builder.createLong(0, 0));
};
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} variablesOffset
*/
nd4j.graph.FlatInferenceRequest.addVariables = function(builder, variablesOffset) {
builder.addFieldOffset(1, variablesOffset, 0);
};
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<flatbuffers.Offset>} data
* @returns {flatbuffers.Offset}
*/
nd4j.graph.FlatInferenceRequest.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.FlatInferenceRequest.startVariablesVector = function(builder, numElems) {
builder.startVector(4, numElems, 4);
};
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} configurationOffset
*/
nd4j.graph.FlatInferenceRequest.addConfiguration = function(builder, configurationOffset) {
builder.addFieldOffset(2, configurationOffset, 0);
};
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
*/
nd4j.graph.FlatInferenceRequest.endFlatInferenceRequest = function(builder) {
var offset = builder.endObject();
return offset;
};
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} offset
*/
nd4j.graph.FlatInferenceRequest.finishFlatInferenceRequestBuffer = function(builder, offset) {
builder.finish(offset);
};
// Exports for Node.js and RequireJS
this.nd4j = nd4j;