mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-25 19:55:03 +00:00
Refactored docstring to google style
This commit is contained in:
@@ -9,15 +9,19 @@ from colossalai.utils import get_current_device, synchronize
|
||||
|
||||
|
||||
def ring_forward(tensor_send_next: torch.Tensor, parallel_mode: ParallelMode):
|
||||
"""Sends a tensor to the next member and recieves a tensor from the previous member.
|
||||
This function returns the recieved tensor from the previous member.
|
||||
"""Sends a tensor to the next member and receives a tensor from the previous member.
|
||||
This function returns the received tensor from the previous member.
|
||||
|
||||
:param tensor_send_next: Tensor sent to next member
|
||||
:param parallel_mode: Parallel group mode used in this communication
|
||||
:type tensor_send_next: :class:`torch.Tensor`
|
||||
:type parallel_mode: :class:`colossalai.context.ParallelMode`
|
||||
:return: The tensor recieved from the previous
|
||||
:rtype: :class:`torch.Tensor`
|
||||
Args:
|
||||
tensor_send_next: Tensor sent to next member
|
||||
parallel_mode: Parallel group mode used in this communication
|
||||
|
||||
Returns:
|
||||
:class:`torch.Tensor`: The tensor received from the previous.
|
||||
|
||||
Note:
|
||||
The parallel_mode should be concluded in ``ParallelMode``. More details about ``ParallelMode`` could be found
|
||||
in `parallel_mode <https://github.com/hpcaitech/ColossalAI/blob/main/colossalai/context/parallel_mode.py>`_.
|
||||
"""
|
||||
buffer_shape = tensor_send_next.size()
|
||||
|
||||
|
Reference in New Issue
Block a user