Download mosesdecoder/moses2/PhraseBased/CubePruningMiniStack/Stack.h from sleepyhead111/vllm_fairseq: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/moses2/PhraseBased/CubePruningMiniStack/Stack.h
- Command line
-
hf download hf://sleepyhead111/vllm_fairseq/mosesdecoder/moses2/PhraseBased/CubePruningMiniStack/Stack.h
-
curl -L -o Stack.h https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/moses2/PhraseBased/CubePruningMiniStack/Stack.h
1.47 kB
| /* | |
| * Stack.h | |
| * | |
| * Created on: 24 Oct 2015 | |
| * Author: hieu | |
| */ | |
| namespace Moses2 | |
| { | |
| class Manager; | |
| class HypothesisBase; | |
| class ArcLists; | |
| namespace NSCubePruningMiniStack | |
| { | |
| class Stack | |
| { | |
| protected: | |
| public: | |
| typedef std::pair<const Bitmap*, size_t> HypoCoverage; | |
| // bitmap and current endPos of hypos | |
| typedef boost::unordered_map<HypoCoverage, Moses2::HypothesisColl*, | |
| boost::hash<HypoCoverage>, std::equal_to<HypoCoverage>, | |
| MemPoolAllocator<std::pair<HypoCoverage, Moses2::HypothesisColl*> > > Coll; | |
| Stack(const Manager &mgr); | |
| virtual ~Stack(); | |
| size_t GetHypoSize() const; | |
| Coll &GetColl() { | |
| return m_coll; | |
| } | |
| const Coll &GetColl() const { | |
| return m_coll; | |
| } | |
| void Add(Hypothesis *hypo, Recycler<HypothesisBase*> &hypoRecycle, | |
| ArcLists &arcLists); | |
| Moses2::HypothesisColl &GetMiniStack(const HypoCoverage &key); | |
| const Hypothesis *GetBestHypo() const; | |
| void Clear(); | |
| void DebugCounts(); | |
| protected: | |
| const Manager &m_mgr; | |
| Coll m_coll; | |
| std::deque<Moses2::HypothesisColl*, MemPoolAllocator<Moses2::HypothesisColl*> > m_miniStackRecycler; | |
| }; | |
| } | |
| } | |