We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HI, I want to use one modelList to contain many layer, for Embedding layer ,why can not contain it ?
import torch.* import torch.nn.modules.{HasParams, TensorModule} class MultiLayerPerceptron[ParamType <: FloatNN : Default](input_dim: Long, embed_dims: Seq[Int], dropout: Double, output_layer: Boolean = true) extends HasParams[ParamType] with TensorModule[ParamType] { val layers = nn.ModuleList[ParamType]() embed_dims.zipWithIndex.foreach { case (embed_dim, index) => { val block = register(LinearBnReluDropBlock(input_dim, embed_dim, dropout)) layers.append(block) } } if (output_layer) { var output_linear = register(nn.Linear(input_dim, 1)) layers.append(output_linear) } layers.append(nn.Embedding(10, 45))
console log error
MultiLayerPerceptron.scala:24:17 Found: torch.nn.modules.sparse.Embedding[ParamType] Required: torch.nn.modules.TensorModule[ParamType] layers.append(nn.Embedding(10, 45))
but nn.Embedding layer is TensorModule's sub class ,why linear and conv2d could add ? is cause by the layer class Type parameters ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
HI,
I want to use one modelList to contain many layer, for Embedding layer ,why can not contain it ?
console log error
but nn.Embedding layer is TensorModule's sub class ,why linear and conv2d could add ? is cause by the layer class Type parameters ?
The text was updated successfully, but these errors were encountered: