Giter Club home page Giter Club logo

Comments (1)

ShangzhiH avatar ShangzhiH commented on June 4, 2024 1

你可以看一下tf.app.run()这个函数的源码,它里面会找当前模块下的main函数,就是你这个函数,然后执行的时候会传入一个参数:
image
所以如果你把下划线去掉,就表示这个main函数是不带参数的就会报错:
image
提示输入了一个参数,但是函数不带参数。
然后下划线在python里是一个通用的表示符号,你可以把这里的这个下划线改成任意字母都可以,就是表示一个参数,只是下划线一般说明这个参数之后不会被使用。比如在python里经常用下划线表示unzip之后不用的变量,eg:a, _ = (1, 2),a就等于1,另外一个变量我不需要,就可以用_代替。

from chinesener.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.