• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python error_interpolation.interpolate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: testNodeThreeHasColocationInterpolation

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


示例17: testTwoTagsWithSeps

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


示例18: testNodeOneHasExactlyOneInterpolatedDevice

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


示例19: testNothingToDo

 def testNothingToDo(self):
   normal_string = "This is just a normal string"
   interpolated_string = error_interpolation.interpolate(
       normal_string, self.graph)
   self.assertEqual(interpolated_string, normal_string)
开发者ID:mbrukman,项目名称:tensorflow,代码行数:5,代码来源:error_interpolation_test.py


示例20: testOneTagWithAFakeNameResultsInPlaceholders

 def testOneTagWithAFakeNameResultsInPlaceholders(self):
   one_tag_string = "^^node:MinusOne^^"
   interpolated_string = error_interpolation.interpolate(
       one_tag_string, self.graph)
   self.assertEqual(one_tag_string, interpolated_string)
开发者ID:mbrukman,项目名称:tensorflow,代码行数:5,代码来源:error_interpolation_test.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python errors.raise_exception_on_not_ok_status函数代码示例发布时间:2022-05-27
下一篇:
Python dtypes.as_dtype函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap