wzhe06/SparrowRecSys

randomwalk函数

monkeyshichi opened this issue · 1 comments

老师,你好,我是极客时间的学员,请问这个embedding.scala 中randomwalk函数 最后一行代码 Seq(sample.toList : _*)
sample.toList : 下划线*是什么意思? 冒号及下划线*是干嘛的?

参考 https://stackoverflow.com/questions/7938585/what-does-param-mean-in-scala

This notation tells the compiler to pass each element of arr as its own argument to echo, rather than all of it as a single argument.

这里简单说,是为了生成Seq时给初始化变量,相当于把toList里面的元素展开。