[TF FE] Fix leftovers from review (#16619)

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
This commit is contained in:
Roman Kazantsev 2023-03-29 16:28:37 +04:00 committed by GitHub
parent f7e898893d
commit 0c2308506f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ public:
std::ifstream pbtxt_stream(path, std::ios::in); std::ifstream pbtxt_stream(path, std::ios::in);
FRONT_END_GENERAL_CHECK(pbtxt_stream && pbtxt_stream.is_open(), "Model file does not exist"); FRONT_END_GENERAL_CHECK(pbtxt_stream && pbtxt_stream.is_open(), "Model file does not exist");
auto input_stream = std::make_shared<::google::protobuf::io::IstreamInputStream>(&pbtxt_stream); auto input_stream = std::make_shared<::google::protobuf::io::IstreamInputStream>(&pbtxt_stream);
FRONT_END_GENERAL_CHECK(input_stream, "Model cannot be read");
auto is_parsed = ::google::protobuf::TextFormat::Parse(input_stream.get(), m_graph_def.get()); auto is_parsed = ::google::protobuf::TextFormat::Parse(input_stream.get(), m_graph_def.get());
FRONT_END_GENERAL_CHECK( FRONT_END_GENERAL_CHECK(
is_parsed, is_parsed,

View File

@ -23,6 +23,7 @@ class TestBucketize(CommonTFLayerTest):
with tf.compat.v1.Session() as sess: with tf.compat.v1.Session() as sess:
input = tf.compat.v1.placeholder(input_type, input_shape, 'input') input = tf.compat.v1.placeholder(input_type, input_shape, 'input')
# generate boundaries list # generate boundaries list
# use wider range for boundaries than input data in order to cover all bucket indices cases
boundaries = np.sort(np.unique(np.random.randint(-200, 200, [boundaries_size]).astype(np.float32))).tolist() boundaries = np.sort(np.unique(np.random.randint(-200, 200, [boundaries_size]).astype(np.float32))).tolist()
tf.raw_ops.Bucketize(input=input, boundaries=boundaries) tf.raw_ops.Bucketize(input=input, boundaries=boundaries)
tf.compat.v1.global_variables_initializer() tf.compat.v1.global_variables_initializer()