def test_string_strip_with_empty_strings(self): strings = [" hello ", "", "world ", " \t \r \n "] with self.cached_session() as sess: output = string_ops.string_strip(strings) output = sess.run(output) self.assertAllEqual(output, [b"hello", b"", b"world", b""])
def test_string_strip(self): strings = ["pigs on the wing", "animals"] with self.cached_session() as sess: output = string_ops.string_strip(strings) output = sess.run(output) self.assertAllEqual(output, [b"pigs on the wing", b"animals"])
def test_string_strip_2d(self): strings = [["pigs on the wing", "animals"], [" hello ", "\n\tworld \r \n"]] with self.cached_session() as sess: output = string_ops.string_strip(strings) output = sess.run(output) self.assertAllEqual(output, [[b"pigs on the wing", b"animals"], [b"hello", b"world"]])
def test_string_strip_2d(self): strings = [["pigs on the wing", "animals"], [" hello ", "\n\tworld \r \n"]] with self.test_session() as sess: output = string_ops.string_strip(strings) output = sess.run(output) self.assertAllEqual(output, [[b"pigs on the wing", b"animals"], [b"hello", b"world"]])