当前位置: 首页>>代码示例>>Python>>正文


Python error_interpolation.interpolate函数代码示例

本文整理汇总了Python中tensorflow.python.framework.error_interpolation.interpolate函数的典型用法代码示例。如果您正苦于以下问题:Python interpolate函数的具体用法?Python interpolate怎么用?Python interpolate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了interpolate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testNoInputs

 def testNoInputs(self):
   two_tags_with_seps = ";;;{{node One}},,,{{node Two}};;;"
   interpolated_string = error_interpolation.interpolate(
       two_tags_with_seps, self.graph)
   expected_regex = (
       r"^;;;.*constant_op.py:[0-9]+\) ,,,.*constant_op.py:[0-9]+\) ;;;$")
   self.assertRegexpMatches(interpolated_string, expected_regex)
开发者ID:Wajih-O,项目名称:tensorflow,代码行数:7,代码来源:error_interpolation_test.py

示例2: testBasicInputs

 def testBasicInputs(self):
   tag = ";;;{{node Three}};;;"
   interpolated_string = error_interpolation.interpolate(tag, self.graph)
   expected_regex = re.compile(
       r"^;;;.*op_def_library.py:[0-9]+\) ;;;.*Input.*constant_op.py:[0-9]+\)",
       re.DOTALL)
   self.assertRegexpMatches(interpolated_string, expected_regex)
开发者ID:Wajih-O,项目名称:tensorflow,代码行数:7,代码来源:error_interpolation_test.py

示例3: testOneTag

 def testOneTag(self):
   one_tag_string = "^^node:Two:${file}^^"
   interpolated_string = error_interpolation.interpolate(one_tag_string,
                                                         self.graph)
   self.assertTrue(interpolated_string.endswith("constant_op.py"),
                   "interpolated_string '%s' did not end with constant_op.py"
                   % interpolated_string)
开发者ID:StephenOman,项目名称:tensorflow,代码行数:7,代码来源:error_interpolation_test.py

示例4: testTwoTagsWithSeps

 def testTwoTagsWithSeps(self):
   two_tags_with_seps = ";;;^^node:Two^^,,,^^node:Three^^;;;"
   interpolated_string = error_interpolation.interpolate(
       two_tags_with_seps, self.graph)
   expected_regex = (
       r"^;;;.*constant_op.py:[0-9]+\) ,,,.*constant_op.py:[0-9]*\) ;;;$")
   self.assertRegexpMatches(interpolated_string, expected_regex)
开发者ID:mbrukman,项目名称:tensorflow,代码行数:7,代码来源:error_interpolation_test.py

示例5: testNodeTwoHasTwoInterpolatedDevice

 def testNodeTwoHasTwoInterpolatedDevice(self):
   message = "^^node:two:${devices}^^"
   result = error_interpolation.interpolate(message, self.graph)
   num_devices = result.count("tf.device")
   self.assertEqual(2, num_devices)
   self.assertIn("tf.device(/cpu)", result)
   self.assertIn("tf.device(/cpu:0)", result)
开发者ID:StephenOman,项目名称:tensorflow,代码行数:7,代码来源:error_interpolation_test.py

示例6: testNodeFourHasColocationInterpolationForNodeThreeOnly

 def testNodeFourHasColocationInterpolationForNodeThreeOnly(self):
   message = "^^colocation_node:Four_with_three^^"
   result = error_interpolation.interpolate(message, self.graph)
   self.assertIn("colocate_with(Three_with_one)", result)
   self.assertNotIn(
       "One", result,
       "Node One should not appear in Four_with_three's summary:\n%s" % result)
开发者ID:mbrukman,项目名称:tensorflow,代码行数:7,代码来源:error_interpolation_test.py

示例7: testNodeThreeHasFancyFunctionDisplayNameForInterpolatedDevice

 def testNodeThreeHasFancyFunctionDisplayNameForInterpolatedDevice(self):
   message = "^^colocation_node:three^^"
   result = error_interpolation.interpolate(message, self.graph)
   num_devices = result.count("tf.device")
   self.assertEqual(2, num_devices)
   name_re = r"_fancy_device_function<.*error_interpolation_test.py, [0-9]+>"
   expected_re = r"with tf.device\(.*%s\)" % name_re
   self.assertRegexpMatches(result, expected_re)
开发者ID:mbrukman,项目名称:tensorflow,代码行数:8,代码来源:error_interpolation_test.py

示例8: testNodeTwoHasTwoInterpolatedDevice

 def testNodeTwoHasTwoInterpolatedDevice(self):
   message = "^^colocation_node:two^^"
   result = error_interpolation.interpolate(message, self.graph)
   self.assertEqual(2, result.count("tf.device(/cpu)"))
   self.assertEqual(2, result.count("tf.device(/cpu:0)"))
开发者ID:mbrukman,项目名称:tensorflow,代码行数:5,代码来源:error_interpolation_test.py

示例9: testNewLine

 def testNewLine(self):
   newline = "\n\n{{node One}}"
   interpolated_string = error_interpolation.interpolate(newline, self.graph)
   self.assertRegexpMatches(interpolated_string, "constant_op.py:[0-9]+.*")
开发者ID:AnishShah,项目名称:tensorflow,代码行数:4,代码来源:error_interpolation_test.py

示例10: testNodeZeroHasNoDeviceSummaryInfo

 def testNodeZeroHasNoDeviceSummaryInfo(self):
   message = "^^colocation_node:zero^^"
   result = error_interpolation.interpolate(message, self.graph)
   self.assertIn("No device assignments were active", result)
开发者ID:mbrukman,项目名称:tensorflow,代码行数:4,代码来源:error_interpolation_test.py

示例11: testNodeOneHasExactlyOneInterpolatedDevice

 def testNodeOneHasExactlyOneInterpolatedDevice(self):
   message = "^^colocation_node:one^^"
   result = error_interpolation.interpolate(message, self.graph)
   self.assertEqual(2, result.count("tf.device(/cpu)"))
开发者ID:mbrukman,项目名称:tensorflow,代码行数:4,代码来源:error_interpolation_test.py

示例12: testTwoTagsNoSeps

 def testTwoTagsNoSeps(self):
   two_tags_no_seps = "^^node:One^^^^node:Three^^"
   interpolated_string = error_interpolation.interpolate(
       two_tags_no_seps, self.graph)
   self.assertRegexpMatches(interpolated_string,
                            "constant_op.py:[0-9]+.*constant_op.py:[0-9]+")
开发者ID:mbrukman,项目名称:tensorflow,代码行数:6,代码来源:error_interpolation_test.py

示例13: testTwoTagsWithSeps

 def testTwoTagsWithSeps(self):
   two_tags_with_seps = "123^^node:Foo:${file}^^456^^node:Bar:${line}^^789"
   interpolated_string = error_interpolation.interpolate(two_tags_with_seps)
   self.assertEqual(interpolated_string, "123${file}456${line}789")
开发者ID:Eagle732,项目名称:tensorflow,代码行数:4,代码来源:error_interpolation_test.py

示例14: testTwoTagsNoSeps

 def testTwoTagsNoSeps(self):
   two_tags_no_seps = "^^node:Foo:${file}^^^^node:Bar:${line}^^"
   interpolated_string = error_interpolation.interpolate(two_tags_no_seps)
   self.assertEqual(interpolated_string, "${file}${line}")
开发者ID:Eagle732,项目名称:tensorflow,代码行数:4,代码来源:error_interpolation_test.py

示例15: testNodeFiveHasColocationInterpolationForNodeOneAndTwo

 def testNodeFiveHasColocationInterpolationForNodeOneAndTwo(self):
   message = "^^colocation_node:Five_with_one_with_two^^"
   result = error_interpolation.interpolate(message, self.graph)
   self.assertIn("colocate_with(One)", result)
   self.assertIn("colocate_with(Two)", result)
开发者ID:mbrukman,项目名称:tensorflow,代码行数:5,代码来源:error_interpolation_test.py


注:本文中的tensorflow.python.framework.error_interpolation.interpolate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。