![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
Implementation for Torch of the Tensorflow execution graph Used in training only. More...
#include </home/runner/work/lima/lima/deeplima/libs/static_graph/static_graph.h>
Classes | |
| struct | module_ref_t |
Public Member Functions | |
| StaticGraphImpl (const DictsHolder &dicts, const std::string &script) | |
| StaticGraphImpl (DictsHolder &&dicts, const std::string &script) | |
| StaticGraphImpl () | |
| virtual void | load (torch::serialize::InputArchive &archive) override |
| virtual void | save (torch::serialize::OutputArchive &archive) const override |
| virtual void | set_tags (const std::map< std::string, std::string > &tags) |
| virtual const std::map< std::string, std::string > & | get_tags () const |
| virtual bool | has_tag (const std::string &key) const |
| virtual void | to (torch::Device device, bool non_blocking=false) override |
| std::map< std::string, torch::Tensor > | forward (const std::map< std::string, torch::Tensor > &inputs, const std::string &output_name) |
| std::map< std::string, torch::Tensor > | forward (const std::map< std::string, torch::Tensor > &inputs, const std::vector< std::string > &output_names) |
| template<class InputIt > | |
| std::map< std::string, torch::Tensor > | forward (const std::map< std::string, torch::Tensor > &inputs, InputIt outputs_begin, InputIt outputs_end) |
| virtual void | pretty_dump (std::ostream &stream) const |
| const DictsHolder & | get_dicts () const |
| const std::string & | get_script () const |
| const std::vector< torch::nn::LSTM > & | get_layers_lstm () const |
| const std::vector< torch::nn::Linear > & | get_layers_linear () const |
| const std::vector< torch::nn::Embedding > & | get_layers_embedding () const |
| const std::vector< torch::nn::Dropout > & | get_layers_dropout () const |
| const std::vector< deeplima::nets::torch_modules::DeepBiaffineAttentionDecoder > & | get_layers_deep_biaffine_attn_decoder () const |
| const std::vector< deeplima::nets::torch_modules::DeepBiaffineAttentionLabelDecoder > & | get_layers_deep_biaffine_attn_label_decoder () const |
| torch::nn::Embedding | get_module_by_name (const std::string &name) const |
| const std::string | get_module_name (size_t idx, const std::string &type) const |
Protected Member Functions | |
| virtual void | parse_script (const std::string &script) |
| virtual step_descr_t | parse_script_line (const std::string &line) |
| virtual std::map< std::string, std::string > | parse_options (std::istringstream &ss) |
| virtual std::vector< std::string > | parse_list (std::string &str, char sep) |
| virtual std::vector< int64_t > | parse_iargs (const std::string &str) |
| template<class InputIt > | |
| void | prepare_exec_plan (const std::map< std::string, torch::Tensor > &inputs, InputIt outputs_begin, InputIt outputs_end) |
| template<class InputIt > | |
| std::string | get_exec_plan_key (const std::map< std::string, torch::Tensor > &inputs, InputIt outputs_begin, InputIt outputs_end) |
| template<class T > | |
| T | get_option (const std::map< std::string, std::string > &opts, const std::string &name) |
| bool | get_bool_option (const std::map< std::string, std::string > &opts, const std::string &name) |
| virtual void | create_arg (const std::vector< std::string > &names, const std::map< std::string, std::string > &opts) |
| virtual void | create_submodule_Embedding (const std::string &name, const std::map< std::string, std::string > &opts) |
| virtual void | create_submodule_LSTM (const std::string &name, const std::map< std::string, std::string > &opts) |
| virtual void | create_submodule_Linear (const std::string &name, const std::map< std::string, std::string > &opts) |
| virtual void | create_submodule_Dropout (const std::string &name, const std::map< std::string, std::string > &opts) |
| virtual void | create_submodule_DeepBiaffineAttentionDecoder (const std::string &name, const std::map< std::string, std::string > &opts) |
| virtual void | create_submodule_DeepBiaffineAttentionLabelDecoder (const std::string &name, const std::map< std::string, std::string > &opts) |
| virtual void | init_rnns () |
Protected Attributes | |
| std::map< std::string, std::vector< size_t > > | m_exec_plans |
| DictsHolder | m_dicts |
| std::string | m_script |
| std::map< std::string, std::string > | m_tags |
| std::vector< torch::nn::Embedding > | m_embedding |
| std::vector< torch::nn::LSTM > | m_lstm |
| std::vector< torch::nn::Linear > | m_linear |
| std::vector< torch::nn::Dropout > | m_dropout |
| std::vector< deeplima::nets::torch_modules::DeepBiaffineAttentionDecoder > | m_deep_biaffine_attention_decoder |
| std::vector< deeplima::nets::torch_modules::DeepBiaffineAttentionLabelDecoder > | m_deep_biaffine_attention_label_decoder |
| std::map< std::string, module_ref_t > | m_modules |
| std::set< std::string > | m_args |
| std::map< std::string, size_t > | m_tensor_name_to_idx |
| std::vector< op_t > | m_ops |
| std::map< size_t, size_t > | m_outidx_to_opidx |
Implementation for Torch of the Tensorflow execution graph Used in training only.
Only loaded in inference In pytorch, the graph is implied from the computing and then saved. This is not implemented in libtorch.
Definition at line 31 of file static_graph.h.
| deeplima::nets::StaticGraphImpl::StaticGraphImpl | ( | const DictsHolder & | dicts, |
| const std::string & | script | ||
| ) |
Definition at line 20 of file static_graph.cpp.
| deeplima::nets::StaticGraphImpl::StaticGraphImpl | ( | DictsHolder && | dicts, |
| const std::string & | script | ||
| ) |
Definition at line 28 of file static_graph.cpp.
|
inline |
Definition at line 114 of file static_graph.h.
|
protectedvirtual |
Definition at line 751 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 889 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 901 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 795 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 771 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 815 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 836 of file static_graph.cpp.
|
inline |
Definition at line 130 of file static_graph.h.
|
inline |
Definition at line 138 of file static_graph.h.
|
inline |
Definition at line 146 of file static_graph.h.
|
inlineprotected |
Definition at line 343 of file static_graph.h.
|
inline |
Definition at line 213 of file static_graph.h.
|
inlineprotected |
Definition at line 298 of file static_graph.h.
|
inline |
Definition at line 411 of file static_graph.h.
|
inline |
Definition at line 416 of file static_graph.h.
|
inline |
Definition at line 406 of file static_graph.h.
|
inline |
Definition at line 401 of file static_graph.h.
|
inline |
Definition at line 396 of file static_graph.h.
|
inline |
Definition at line 391 of file static_graph.h.
|
inline |
Definition at line 426 of file static_graph.h.
|
inline |
Definition at line 438 of file static_graph.h.
|
inlineprotected |
Definition at line 324 of file static_graph.h.
|
inline |
Definition at line 385 of file static_graph.h.
|
inlinevirtual |
Definition at line 119 of file static_graph.h.
|
inlinevirtual |
Definition at line 123 of file static_graph.h.
|
protectedvirtual |
Definition at line 943 of file static_graph.cpp.
|
overridevirtual |
Reimplemented in deeplima::nets::BiRnnSeq2SeqImpl, deeplima::nets::BiRnnClassifierImpl, deeplima::graph_dp::train::BiRnnAndDeepBiaffineAttentionImpl, deeplima::lemmatization::train::Seq2SeqLemmatizerImpl, deeplima::segmentation::train::BiRnnClassifierForSegmentationImpl, and deeplima::tagging::train::BiRnnClassifierForNerImpl.
Definition at line 36 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 741 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 593 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 569 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 200 of file static_graph.cpp.
|
protectedvirtual |
Definition at line 611 of file static_graph.cpp.
|
inlineprotected |
Definition at line 228 of file static_graph.h.
|
virtual |
Definition at line 168 of file static_graph.cpp.
|
overridevirtual |
Reimplemented in deeplima::nets::BiRnnSeq2SeqImpl, deeplima::nets::BiRnnClassifierImpl, deeplima::graph_dp::train::BiRnnAndDeepBiaffineAttentionImpl, deeplima::lemmatization::train::Seq2SeqLemmatizerImpl, deeplima::segmentation::train::BiRnnClassifierForSegmentationImpl, and deeplima::tagging::train::BiRnnClassifierForNerImpl.
Definition at line 127 of file static_graph.cpp.
|
virtual |
Definition at line 160 of file static_graph.cpp.
|
overridevirtual |
Definition at line 188 of file static_graph.cpp.
|
protected |
Definition at line 500 of file static_graph.h.
|
protected |
Definition at line 380 of file static_graph.h.
|
protected |
Definition at line 381 of file static_graph.h.
|
protected |
Definition at line 372 of file static_graph.h.
|
protected |
Definition at line 379 of file static_graph.h.
|
protected |
Definition at line 376 of file static_graph.h.
|
protected |
Definition at line 225 of file static_graph.h.
|
protected |
Definition at line 378 of file static_graph.h.
|
protected |
Definition at line 377 of file static_graph.h.
|
protected |
Definition at line 499 of file static_graph.h.
|
protected |
Definition at line 502 of file static_graph.h.
|
protected |
Definition at line 503 of file static_graph.h.
|
protected |
Definition at line 373 of file static_graph.h.
|
protected |
Definition at line 374 of file static_graph.h.
|
protected |
Definition at line 501 of file static_graph.h.