Skip to content

Commit ed860ef

Browse files
committed
bernoulli, beta, exponential, gamma, lognormal
1 parent 5a5ecae commit ed860ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4734
-23
lines changed

cpp/ppx_generated.h

Lines changed: 393 additions & 5 deletions
Large diffs are not rendered by default.

csharp/ppx/Bernoulli.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// <auto-generated>
2+
// automatically generated by the FlatBuffers compiler, do not modify
3+
// </auto-generated>
4+
5+
namespace ppx
6+
{
7+
8+
using global::System;
9+
using global::System.Collections.Generic;
10+
using global::FlatBuffers;
11+
12+
public struct Bernoulli : IFlatbufferObject
13+
{
14+
private Table __p;
15+
public ByteBuffer ByteBuffer { get { return __p.bb; } }
16+
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
17+
public static Bernoulli GetRootAsBernoulli(ByteBuffer _bb) { return GetRootAsBernoulli(_bb, new Bernoulli()); }
18+
public static Bernoulli GetRootAsBernoulli(ByteBuffer _bb, Bernoulli obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
19+
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
20+
public Bernoulli __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21+
22+
public ppx.Tensor? Probs { get { int o = __p.__offset(4); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
23+
24+
public static Offset<ppx.Bernoulli> CreateBernoulli(FlatBufferBuilder builder,
25+
Offset<ppx.Tensor> probsOffset = default(Offset<ppx.Tensor>)) {
26+
builder.StartTable(1);
27+
Bernoulli.AddProbs(builder, probsOffset);
28+
return Bernoulli.EndBernoulli(builder);
29+
}
30+
31+
public static void StartBernoulli(FlatBufferBuilder builder) { builder.StartTable(1); }
32+
public static void AddProbs(FlatBufferBuilder builder, Offset<ppx.Tensor> probsOffset) { builder.AddOffset(0, probsOffset.Value, 0); }
33+
public static Offset<ppx.Bernoulli> EndBernoulli(FlatBufferBuilder builder) {
34+
int o = builder.EndTable();
35+
return new Offset<ppx.Bernoulli>(o);
36+
}
37+
};
38+
39+
40+
}

csharp/ppx/Beta.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// <auto-generated>
2+
// automatically generated by the FlatBuffers compiler, do not modify
3+
// </auto-generated>
4+
5+
namespace ppx
6+
{
7+
8+
using global::System;
9+
using global::System.Collections.Generic;
10+
using global::FlatBuffers;
11+
12+
public struct Beta : IFlatbufferObject
13+
{
14+
private Table __p;
15+
public ByteBuffer ByteBuffer { get { return __p.bb; } }
16+
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
17+
public static Beta GetRootAsBeta(ByteBuffer _bb) { return GetRootAsBeta(_bb, new Beta()); }
18+
public static Beta GetRootAsBeta(ByteBuffer _bb, Beta obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
19+
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
20+
public Beta __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21+
22+
public ppx.Tensor? Concentration1 { get { int o = __p.__offset(4); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
23+
public ppx.Tensor? Concentration0 { get { int o = __p.__offset(6); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
24+
25+
public static Offset<ppx.Beta> CreateBeta(FlatBufferBuilder builder,
26+
Offset<ppx.Tensor> concentration1Offset = default(Offset<ppx.Tensor>),
27+
Offset<ppx.Tensor> concentration0Offset = default(Offset<ppx.Tensor>)) {
28+
builder.StartTable(2);
29+
Beta.AddConcentration0(builder, concentration0Offset);
30+
Beta.AddConcentration1(builder, concentration1Offset);
31+
return Beta.EndBeta(builder);
32+
}
33+
34+
public static void StartBeta(FlatBufferBuilder builder) { builder.StartTable(2); }
35+
public static void AddConcentration1(FlatBufferBuilder builder, Offset<ppx.Tensor> concentration1Offset) { builder.AddOffset(0, concentration1Offset.Value, 0); }
36+
public static void AddConcentration0(FlatBufferBuilder builder, Offset<ppx.Tensor> concentration0Offset) { builder.AddOffset(1, concentration0Offset.Value, 0); }
37+
public static Offset<ppx.Beta> EndBeta(FlatBufferBuilder builder) {
38+
int o = builder.EndTable();
39+
return new Offset<ppx.Beta>(o);
40+
}
41+
};
42+
43+
44+
}

csharp/ppx/Distribution.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public enum Distribution : byte
1212
Uniform = 2,
1313
Categorical = 3,
1414
Poisson = 4,
15+
Bernoulli = 5,
16+
Beta = 6,
17+
Exponential = 7,
18+
Gamma = 8,
19+
LogNormal = 9,
1520
};
1621

1722

csharp/ppx/Exponential.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// <auto-generated>
2+
// automatically generated by the FlatBuffers compiler, do not modify
3+
// </auto-generated>
4+
5+
namespace ppx
6+
{
7+
8+
using global::System;
9+
using global::System.Collections.Generic;
10+
using global::FlatBuffers;
11+
12+
public struct Exponential : IFlatbufferObject
13+
{
14+
private Table __p;
15+
public ByteBuffer ByteBuffer { get { return __p.bb; } }
16+
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
17+
public static Exponential GetRootAsExponential(ByteBuffer _bb) { return GetRootAsExponential(_bb, new Exponential()); }
18+
public static Exponential GetRootAsExponential(ByteBuffer _bb, Exponential obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
19+
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
20+
public Exponential __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21+
22+
public ppx.Tensor? Rate { get { int o = __p.__offset(4); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
23+
24+
public static Offset<ppx.Exponential> CreateExponential(FlatBufferBuilder builder,
25+
Offset<ppx.Tensor> rateOffset = default(Offset<ppx.Tensor>)) {
26+
builder.StartTable(1);
27+
Exponential.AddRate(builder, rateOffset);
28+
return Exponential.EndExponential(builder);
29+
}
30+
31+
public static void StartExponential(FlatBufferBuilder builder) { builder.StartTable(1); }
32+
public static void AddRate(FlatBufferBuilder builder, Offset<ppx.Tensor> rateOffset) { builder.AddOffset(0, rateOffset.Value, 0); }
33+
public static Offset<ppx.Exponential> EndExponential(FlatBufferBuilder builder) {
34+
int o = builder.EndTable();
35+
return new Offset<ppx.Exponential>(o);
36+
}
37+
};
38+
39+
40+
}

csharp/ppx/Gamma.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// <auto-generated>
2+
// automatically generated by the FlatBuffers compiler, do not modify
3+
// </auto-generated>
4+
5+
namespace ppx
6+
{
7+
8+
using global::System;
9+
using global::System.Collections.Generic;
10+
using global::FlatBuffers;
11+
12+
public struct Gamma : IFlatbufferObject
13+
{
14+
private Table __p;
15+
public ByteBuffer ByteBuffer { get { return __p.bb; } }
16+
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
17+
public static Gamma GetRootAsGamma(ByteBuffer _bb) { return GetRootAsGamma(_bb, new Gamma()); }
18+
public static Gamma GetRootAsGamma(ByteBuffer _bb, Gamma obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
19+
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
20+
public Gamma __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21+
22+
public ppx.Tensor? Concentration { get { int o = __p.__offset(4); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
23+
public ppx.Tensor? Rate { get { int o = __p.__offset(6); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
24+
25+
public static Offset<ppx.Gamma> CreateGamma(FlatBufferBuilder builder,
26+
Offset<ppx.Tensor> concentrationOffset = default(Offset<ppx.Tensor>),
27+
Offset<ppx.Tensor> rateOffset = default(Offset<ppx.Tensor>)) {
28+
builder.StartTable(2);
29+
Gamma.AddRate(builder, rateOffset);
30+
Gamma.AddConcentration(builder, concentrationOffset);
31+
return Gamma.EndGamma(builder);
32+
}
33+
34+
public static void StartGamma(FlatBufferBuilder builder) { builder.StartTable(2); }
35+
public static void AddConcentration(FlatBufferBuilder builder, Offset<ppx.Tensor> concentrationOffset) { builder.AddOffset(0, concentrationOffset.Value, 0); }
36+
public static void AddRate(FlatBufferBuilder builder, Offset<ppx.Tensor> rateOffset) { builder.AddOffset(1, rateOffset.Value, 0); }
37+
public static Offset<ppx.Gamma> EndGamma(FlatBufferBuilder builder) {
38+
int o = builder.EndTable();
39+
return new Offset<ppx.Gamma>(o);
40+
}
41+
};
42+
43+
44+
}

csharp/ppx/LogNormal.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// <auto-generated>
2+
// automatically generated by the FlatBuffers compiler, do not modify
3+
// </auto-generated>
4+
5+
namespace ppx
6+
{
7+
8+
using global::System;
9+
using global::System.Collections.Generic;
10+
using global::FlatBuffers;
11+
12+
public struct LogNormal : IFlatbufferObject
13+
{
14+
private Table __p;
15+
public ByteBuffer ByteBuffer { get { return __p.bb; } }
16+
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
17+
public static LogNormal GetRootAsLogNormal(ByteBuffer _bb) { return GetRootAsLogNormal(_bb, new LogNormal()); }
18+
public static LogNormal GetRootAsLogNormal(ByteBuffer _bb, LogNormal obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
19+
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
20+
public LogNormal __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
21+
22+
public ppx.Tensor? Loc { get { int o = __p.__offset(4); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
23+
public ppx.Tensor? Scale { get { int o = __p.__offset(6); return o != 0 ? (ppx.Tensor?)(new ppx.Tensor()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
24+
25+
public static Offset<ppx.LogNormal> CreateLogNormal(FlatBufferBuilder builder,
26+
Offset<ppx.Tensor> locOffset = default(Offset<ppx.Tensor>),
27+
Offset<ppx.Tensor> scaleOffset = default(Offset<ppx.Tensor>)) {
28+
builder.StartTable(2);
29+
LogNormal.AddScale(builder, scaleOffset);
30+
LogNormal.AddLoc(builder, locOffset);
31+
return LogNormal.EndLogNormal(builder);
32+
}
33+
34+
public static void StartLogNormal(FlatBufferBuilder builder) { builder.StartTable(2); }
35+
public static void AddLoc(FlatBufferBuilder builder, Offset<ppx.Tensor> locOffset) { builder.AddOffset(0, locOffset.Value, 0); }
36+
public static void AddScale(FlatBufferBuilder builder, Offset<ppx.Tensor> scaleOffset) { builder.AddOffset(1, scaleOffset.Value, 0); }
37+
public static Offset<ppx.LogNormal> EndLogNormal(FlatBufferBuilder builder) {
38+
int o = builder.EndTable();
39+
return new Offset<ppx.LogNormal>(o);
40+
}
41+
};
42+
43+
44+
}

0 commit comments

Comments
 (0)