| 428 | |
| 429 | template<typename T> |
| 430 | inline T getValWithOffset(const std::string& key, size_t index) const |
| 431 | { |
| 432 | FT_CHECK_WITH_INFO(isExist(key), |
| 433 | fmtstr("Cannot find a tensor of name %s in the tensor map (keys: %s)", |
| 434 | key.c_str(), |
| 435 | vec2str(keys()).c_str())); |
| 436 | return tensor_map_.at(key).getVal<T>(index); |
| 437 | } |
| 438 | |
| 439 | template<typename T> |
| 440 | inline T getValWithOffset(const std::string& key, size_t index, T default_value) const |