コード例 #1
0
    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""])
コード例 #2
0
    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"])
コード例 #3
0
  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""])
コード例 #4
0
  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"])
コード例 #5
0
  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"]])
コード例 #6
0
  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"]])