如图:
python 计时器 timeit 报错 NameError: name 'xxx' is not defined
原因是timeit()没法使用外部的变量或函数,我们要加一个导入,这样就可以了:
python 计时器 timeit 报错 NameError: name 'xxx' is not defined
以下是一个案例:
如图,需要将相对于timeit()外部的tf、x都导入
python 计时器 timeit 报错 NameError: name 'xxx' is not defined
参考文章:tensorflow 学习笔记 之 Eager execution 急切执行

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2021-05-17
  • 2021-06-18
  • 2022-12-23
猜你喜欢
  • 2021-06-21
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-04-17
  • 2022-12-23
相关资源
相似解决方案