作者stayfool (fool)
看板Python
标题[问题] for 回圈语法问题
时间Thu Feb 11 16:56:17 2021
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()?
这种写法是代表什麽意思,求解,谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.163.205.88 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1613033779.A.C89.html
1F:推 museangel: google一下list comprehension 02/11 17:15
2F:→ kwanza: generator expression 02/12 02:15