提交 18ec8e26 编写于 作者: T Tiezhen WANG 提交者: TensorFlower Gardener

TFL: Fix Subgraph::context_ initialization.

As more and more methods have been added to context_, having a default null initialization of context_ make it safer.

context_ is a POD-struct so no default initializer. context_() will zero-initialize all the members.

PiperOrigin-RevId: 284514663
Change-Id: I21838fc7c769911db9585088f4094b461bb3518a
上级 e9bdde2f
......@@ -532,7 +532,7 @@ class Subgraph {
// A pure C data structure used to communicate with the pure C plugin
// interface. To avoid copying tensor metadata, this is also the definitive
// structure to store tensors.
TfLiteContext context_;
TfLiteContext context_ = {};
// A pointer to the external contexts (kTfLiteMaxExternalContexts) array that
// sits inside the associated TFLite interpreter instance.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册