-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add merge pooled emb docstring (#3172)
Summary: X-link: facebookresearch/FBGEMM#266 As title Pull Request resolved: #3172 Differential Revision: D63391637 Pulled By: sryap
- Loading branch information
1 parent
48d055f
commit 63f5b8d
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
fbgemm_gpu/docs/src/fbgemm_gpu-python-api/pooled_embedding_ops.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Pooled Embedding Operators | ||
========================== | ||
|
||
.. automodule:: fbgemm_gpu | ||
|
||
.. autofunction:: torch.ops.fbgemm.merge_pooled_embeddings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
import torch | ||
|
||
from .common import add_docs | ||
|
||
add_docs( | ||
torch.ops.fbgemm.merge_pooled_embeddings, | ||
""" | ||
merge_pooled_embeddings(pooled_embeddings, uncat_dim_size, target_device, cat_dim=1) -> Tensor | ||
Concatenate embedding outputs from different devices (on the same host) | ||
on to the target device. | ||
Args: | ||
pooled_embeddings (List[Tensor]): A list of embedding outputs from | ||
different devices on the same host. Each output has 2 | ||
dimensions. | ||
uncat_dim_size (int): The size of the dimension that is not | ||
concatenated, i.e., if `cat_dim=0`, `uncat_dim_size` is the size | ||
of dim 1 and vice versa. | ||
target_device (torch.device): The target device that aggregates all | ||
the embedding outputs. | ||
cat_dim (int = 1): The dimension that the tensors are concatenated | ||
Returns: | ||
The concatenated embedding output (2D) on the target device | ||
""", | ||
) |