5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

python > 複数行の書き方 > mnist_with_summaries.pyでの書き方 > 行連結記号がなくてもよさそう

Last updated at Posted at 2016-10-26
動作環境
Ubuntu 14.04 LTS desktop amd64
GeForce GTX 750 Ti
ASRock Z170M Pro4S [Intel Z170chipset]
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v7.5
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.

過去にいくつかの言語での行連結について記事にした。
http://qiita.com/7of9/items/021bb0fa9443c2efc44b

TensorFlowというDeep Learningようフレームワーク?のコード mnist_with_summaries.pyにおいて以下のコードを見つけた。

  with tf.name_scope('train'):
    train_step = tf.train.AdamOptimizer(FLAGS.learning_rate).minimize(
        cross_entropy)

行連結記号がなくてもいいようだ。

文字列の連結の場合は以下のリンク先に紹介されている。
[Python]文字列を複数行に分けて書きたい @ memlogさん

ideoneで確認

def func_print(var):
	print var

var = 3.14
func_print(var)
func_print(
	var)

「関数の引数に関しては」という条件つきかもしれない。

5
5
7

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?