MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / get_tensor

Method get_tensor

smallthinker/src/llama-model.cpp:4746–4756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4744}
4745
4746const ggml_tensor * llama_model::get_tensor(const char * name) const {
4747 auto it = std::find_if(tensors_by_name.begin(), tensors_by_name.end(),
4748 [name](const std::pair<std::string, ggml_tensor *> & it) {
4749 return it.first == name;
4750 });
4751 if (it == tensors_by_name.end()) {
4752 return nullptr;
4753 }
4754
4755 return it->second;
4756}
4757
4758float llama_model::get_rope_freq_base (const llama_cparams & cparams, int il) const {
4759 return hparams.is_swa(il) ? hparams.rope_freq_base_train_swa : cparams.rope_freq_base;

Callers 3

get_tensorsMethod · 0.45
get_tensorsMethod · 0.45

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected