File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
tensorflow/contrib/tensorrt Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ tf_custom_op_library(
5252 "ops/trt_engine_op.cc" ,
5353 ],
5454 deps = [
55- ":trt_engine_op_kernel" ,
5655 ":trt_shape_function" ,
5756 "//tensorflow/core:lib_proto_parsing" ,
5857 ] + if_tensorrt ([
@@ -183,6 +182,7 @@ tf_py_wrap_cc(
183182 copts = tf_copts (),
184183 deps = [
185184 ":trt_conversion" ,
185+ ":trt_engine_op_kernel" ,
186186 "//tensorflow/core:framework_lite" ,
187187 "//util/python:python_headers" ,
188188 ],
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ limitations under the License.
1919namespace tensorflow {
2020namespace tensorrt {
2121
22+ std::shared_ptr<TRTResourceManager>
23+ tensorflow::tensorrt::TRTResourceManager::instance () {
24+ static std::shared_ptr<TRTResourceManager> instance_ (new TRTResourceManager);
25+ return instance_;
26+ }
27+
2228std::shared_ptr<tensorflow::ResourceMgr>
2329tensorflow::tensorrt::TRTResourceManager::getManager (const string& op_name) {
2430 // mutex is held for lookup only. Most instantiations where mutex will be held
Original file line number Diff line number Diff line change @@ -29,11 +29,7 @@ class TRTResourceManager {
2929 TRTResourceManager () = default ;
3030
3131 public:
32- static std::shared_ptr<TRTResourceManager> instance () {
33- static std::shared_ptr<TRTResourceManager> instance_ (
34- new TRTResourceManager);
35- return instance_;
36- }
32+ static std::shared_ptr<TRTResourceManager> instance ();
3733 // returns a manager for given op, if it doesn't exists it creates one
3834 std::shared_ptr<tensorflow::ResourceMgr> getManager (const string& op_name);
3935
You can’t perform that action at this time.
0 commit comments