-- automatically generated by the FlatBuffers compiler, do not modify

-- namespace: ppx

local flatbuffers = require('flatbuffers')

local Binomial = {} -- the module
local Binomial_mt = {} -- the class metatable

function Binomial.New()
    local o = {}
    setmetatable(o, {__index = Binomial_mt})
    return o
end
function Binomial.GetRootAsBinomial(buf, offset)
    if type(buf) == "string" then
        buf = flatbuffers.binaryArray.New(buf)
    end
    local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
    local o = Binomial.New()
    o:Init(buf, n + offset)
    return o
end
function Binomial_mt:Init(buf, pos)
    self.view = flatbuffers.view.New(buf, pos)
end
function Binomial_mt:TotalCount()
    local o = self.view:Offset(4)
    if o ~= 0 then
        local x = self.view:Indirect(o + self.view.pos)
        local obj = require('ppx.Tensor').New()
        obj:Init(self.view.bytes, x)
        return obj
    end
end
function Binomial_mt:Probs()
    local o = self.view:Offset(6)
    if o ~= 0 then
        local x = self.view:Indirect(o + self.view.pos)
        local obj = require('ppx.Tensor').New()
        obj:Init(self.view.bytes, x)
        return obj
    end
end
function Binomial.Start(builder) builder:StartObject(2) end
function Binomial.AddTotalCount(builder, totalCount) builder:PrependUOffsetTRelativeSlot(0, totalCount, 0) end
function Binomial.AddProbs(builder, probs) builder:PrependUOffsetTRelativeSlot(1, probs, 0) end
function Binomial.End(builder) return builder:EndObject() end

return Binomial -- return the module