Skip to content

Commit

Permalink
Update fully_connected.cc documentation (apache#12097)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-haibin-lin authored Aug 9, 2018
1 parent e1227d3 commit 5bb9a22
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/operator/nn/fully_connected.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,15 @@ The learnable parameters include both ``weight`` and ``bias``.
If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
Note that the operator also supports forward computation with `row_sparse` weight and bias,
where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
.. Note::
The sparse support for FullyConnected is limited to forward evaluation with `row_sparse`
weight and bias, where the length of `weight.indices` and `bias.indices` must be equal
to `num_hidden`. This could be useful for model inference with `row_sparse` weights
trained with importance sampling or noise contrastive estimation.
To compute linear transformation with 'csr' sparse data, sparse.dot is recommended instead
of sparse.FullyConnected.
)code" ADD_FILELINE)
.set_num_inputs([](const NodeAttrs& attrs) {
Expand Down

0 comments on commit 5bb9a22

Please sign in to comment.