[問題] for 迴圈語法問題

作者: stayfool (fool)   2021-02-11 16:56:17
tokenizer_en = tfds.features.text.SubwordTextEncoder.build_from_corpus(
(en.numpy() for pt, en in train_examples), target_vocab_size=2**13)
以上是自然語言處理的一段程式碼,
其中的 en.numpy() for pt, en in train_examples
for迴圈前面為何還可以放入函式en.numpy()?
這種寫法是代表什麼意思,求解,謝謝
作者: museangel (museangel)   2021-02-11 17:15:00
google一下list comprehension
作者: kwanza   2021-02-12 02:15:00
generator expression

Links booklink

Contact Us: admin [ a t ] ucptt.com