【发布时间】:2017-10-24 06:02:15
【问题描述】:
现在,我正在研究 Tensorflow Serving 并尝试创建一个自定义 Servable。
所以,我阅读了关于 hashmap_source_adaptor 的代码(这是 Tensorflow Serving 中的示例代码)。
但是,有一些代码,我看不懂。
HashmapSourceAdapter::HashmapSourceAdapter(
const HashmapSourceAdapterConfig& config)
: SimpleLoaderSourceAdapter<StoragePath, Hashmap>(
[config](const StoragePath& path, std::unique_ptr<Hashmap>* hashmap) {
return LoadHashmapFromFile(path, config.format(), hashmap);
},
// Decline to supply a resource footprint estimate.
SimpleLoaderSourceAdapter<StoragePath,
Hashmap>::EstimateNoResources()) {}
HashmapSourceAdapter::~HashmapSourceAdapter() { Detach(); }
第 4 行中的 [config] 是什么意思?
给我一个想法或提示来搜索。
原始代码在此链接中。我无法理解第 70 行。 https://github.com/tensorflow/serving/blob/master/tensorflow_serving/servables/hashmap/hashmap_source_adapter.cc#L70
谢谢。
【问题讨论】: