Fix msan test in tf_saved_model_lift_variables test
Now, all the tenors, generated from lift_variables_test.h, has initialized values. PiperOrigin-RevId: 316969327 Change-Id: If7f68aacf0c931430804dfaa1d73c0ea4be70c75
This commit is contained in:
parent
b6ff68822a
commit
ed2b3d6e1e
@ -96,15 +96,19 @@ class FakeSession : public tensorflow::Session {
|
||||
for (const std::string& output_name : output_names) {
|
||||
Tensor output;
|
||||
if (output_name == "dense/bias") {
|
||||
outputs->push_back(
|
||||
Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({50})));
|
||||
Tensor t = Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({50}));
|
||||
t.flat<float>().setZero();
|
||||
outputs->push_back(t);
|
||||
} else if (output_name == "dense/kernel") {
|
||||
outputs->push_back(
|
||||
Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({100, 50})));
|
||||
Tensor t =
|
||||
Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({100, 50}));
|
||||
t.flat<float>().setZero();
|
||||
outputs->push_back(t);
|
||||
} else {
|
||||
// Create a scalar float tensor.
|
||||
outputs->push_back(
|
||||
Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({})));
|
||||
Tensor t = Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({}));
|
||||
t.flat<float>()(0) = 1.0f;
|
||||
outputs->push_back(t);
|
||||
}
|
||||
}
|
||||
return Status::OK();
|
||||
|
Loading…
x
Reference in New Issue
Block a user