Initialize tensor in graph_properties_test, to avoid msan complaint.

PiperOrigin-RevId: 158169374
This commit is contained in:
A. Unique TensorFlower 2017-06-06 11:51:22 -07:00 committed by TensorFlower Gardener
parent cabc5c35c2
commit 81cf61fdb6
2 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,7 @@ cc_test(
"//tensorflow/cc:scope",
"//tensorflow/core:framework",
"//tensorflow/core:lib_proto_parsing",
"//tensorflow/core:tensor_testutil",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core/grappler:grappler_item",

View File

@ -17,6 +17,7 @@ limitations under the License.
#include "tensorflow/cc/framework/scope.h"
#include "tensorflow/cc/ops/standard_ops.h"
#include "tensorflow/core/framework/node_def_builder.h"
#include "tensorflow/core/framework/tensor_testutil.h"
#include "tensorflow/core/grappler/clusters/single_machine.h"
#include "tensorflow/core/grappler/grappler_item.h"
#include "tensorflow/core/grappler/inputs/trivial_test_graph_input_yielder.h"
@ -158,6 +159,7 @@ TEST_F(GraphPropertiesTest, Variables) {
item.fetch.push_back("Var");
Tensor initial_val(DT_FLOAT, TensorShape({3, 7}));
test::FillIota<float>(&initial_val, 0);
TF_CHECK_OK(NodeDefBuilder("InitialVal", "Const")
.Attr("dtype", DT_FLOAT)
.Attr("value", initial_val)