コード例 #1
0
 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"]])
コード例 #2
0
  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"])
コード例 #3
0
 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"]])
コード例 #4
0
    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"])
コード例 #5
0
ファイル: remote_test.py プロジェクト: zyx5256/tensorflow
 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
コード例 #6
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"]])
コード例 #7
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"]])