def test_string_upper_unicode(self): strings = [["óósschloë"]] with self.cached_session(): output = string_ops.string_upper(strings, encoding="utf-8") output = self.evaluate(output) # output: "ÓÓSSCHLOË" self.assertAllEqual(output, [[b"\xc3\x93\xc3\x93SSCHLO\xc3\x8b"]])
def test_string_upper(self): strings = ["Pigs on The Wing", "aNimals"] with self.cached_session(): output = string_ops.string_upper(strings) output = self.evaluate(output) self.assertAllEqual(output, [b"PIGS ON THE WING", b"ANIMALS"])
def func(): with ops.device('cpu:0'): # Multiple CPU:0 devices match would be found, but the CPU:0 from the # parent device scope should be picked. x = test_ops.device_placement_op() y = string_ops.string_upper(x) packed_var_0 = array_ops.stack([x, y], 0) return packed_var_0
def test_string_upper_2d(self): strings = [["pigS on THE wIng", "aniMals"], [" hello ", "\n\tWorld! \r \n"]] with self.cached_session(): output = string_ops.string_upper(strings) output = self.evaluate(output) self.assertAllEqual(output, [[b"PIGS ON THE WING", b"ANIMALS"], [b" HELLO ", b"\n\tWORLD! \r \n"]])