MCPcopy Create free account
hub / github.com/Tencent/embedx / DeepSamplerSource

Class DeepSamplerSource

src/sampler/sampler_source/deep_sampler_source.cc:29–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27} // namespace
28
29class DeepSamplerSource : public SamplerSource {
30 private:
31 const DeepData& deep_data_;
32
33 public:
34 explicit DeepSamplerSource(const DeepData* deep_data)
35 : deep_data_(*deep_data) {}
36 ~DeepSamplerSource() override = default;
37
38 public:
39 int ns_size() const noexcept override { return deep_data_.ns_size(); }
40 const id_name_t& id_name_map() const noexcept override {
41 return deep_data_.id_name_map();
42 }
43 const std::vector<vec_int_t>& nodes_list() const noexcept override {
44 return deep_data_.nodes_list();
45 }
46 const std::vector<vec_float_t>& freqs_list() const noexcept override {
47 return deep_data_.freqs_list();
48 }
49 const vec_int_t& node_keys() const noexcept override {
50 DXERROR("Node_keys was not implemented in DeepSamplerSource.");
51 return EMPTY_NODE_KEYS;
52 }
53 const vec_pair_t* FindContext(int_t /*node*/) const override {
54 DXERROR("Find_context was not implemented in DeepSamplerSource.");
55 return nullptr;
56 }
57};
58
59std::unique_ptr<SamplerSource> NewDeepSamplerSource(const DeepData* deep_data) {
60 std::unique_ptr<SamplerSource> sampler_source(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected