MCPcopy Create free account
hub / github.com/Tencent/TurboTransformers / BertModel

Class BertModel

example/cpp/bert_model.h:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24using PoolType = layers::types::PoolType;
25
26class BertModel {
27 public:
28 BertModel(const std::string &filename, DLDeviceType device_type,
29 size_t n_layers, int64_t n_heads);
30 ~BertModel();
31
32 std::vector<float> operator()(
33 const std::vector<std::vector<int64_t>> &inputs,
34 const std::vector<std::vector<int64_t>> &poistion_ids,
35 const std::vector<std::vector<int64_t>> &segment_ids,
36 PoolType pooling = PoolType::kFirst, bool use_pooler = false) const;
37
38 private:
39 struct Impl;
40 std::unique_ptr<Impl> m_;
41};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected