refactoring: opt graph key gen
This commit is contained in:
parent
be9a8c73a0
commit
18aa6654d5
1 changed files with 5 additions and 9 deletions
|
@ -82,14 +82,10 @@ template <size_t _InputSize, size_t _OutputSize>
|
|||
std::string get_graph_key(const std::string &op_name, const std::array<ggml_tensor *, _InputSize> &inputs,
|
||||
const std::array<ggml_tensor *, _OutputSize> &outputs) {
|
||||
constexpr static const auto append_dimensions = [](std::string &key, const ggml_tensor *tensor) {
|
||||
key += "_";
|
||||
key += std::to_string(tensor->ne[0]);
|
||||
key += "x";
|
||||
key += std::to_string(tensor->ne[1]);
|
||||
key += "x";
|
||||
key += std::to_string(tensor->ne[2]);
|
||||
key += "x";
|
||||
key += std::to_string(tensor->ne[3]);
|
||||
char buffer[256] = {};
|
||||
snprintf(buffer, sizeof(buffer), "_%ldx%ldx%ldx%ld", (long)tensor->ne[0], (long)tensor->ne[1],
|
||||
(long)tensor->ne[2], (long)tensor->ne[3]);
|
||||
key += buffer;
|
||||
};
|
||||
|
||||
std::string graph_key(op_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue