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));
 }
Example #2
0
 public static Offset <FlatVariable> CreateFlatVariable(FlatBufferBuilder builder,
                                                        Offset <IntPair> idOffset        = default(Offset <IntPair>),
                                                        StringOffset nameOffset          = default(StringOffset),
                                                        VectorOffset shapeOffset         = default(VectorOffset),
                                                        Offset <FlatArray> ndarrayOffset = default(Offset <FlatArray>),
                                                        int device = 0)
 {
     builder.StartObject(5);
     FlatVariable.AddDevice(builder, device);
     FlatVariable.AddNdarray(builder, ndarrayOffset);
     FlatVariable.AddShape(builder, shapeOffset);
     FlatVariable.AddName(builder, nameOffset);
     FlatVariable.AddId(builder, idOffset);
     return(FlatVariable.EndFlatVariable(builder));
 }
 public static FlatVariable GetRootAsFlatVariable(ByteBuffer _bb, FlatVariable obj)
 {
     return(obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb));
 }