Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
hukkai committed Oct 12, 2023
1 parent 2f87a57 commit df478d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mmaction/models/action_segmentors/asformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,13 @@ def __init__(self, in_channels, out_channels):
nn.Conv1d(out_channels, out_channels, 1))

def forward(self, x):
"""Define the computation performed at every call.
Args:
x (torch.Tensor): The input data.
Returns:
torch.Tensor: The output of the module.
"""
return self.layer(x)


Expand Down Expand Up @@ -506,6 +513,13 @@ def __init__(self, d_model, max_len=10000):
# self.register_buffer('pe', pe)

def forward(self, x):
"""Define the computation performed at every call.
Args:
x (torch.Tensor): The input data.
Returns:
torch.Tensor: The output of the module.
"""
return x + self.pe[:, :, 0:x.shape[2]]


Expand Down

0 comments on commit df478d0

Please sign in to comment.