提交 50fe6be3 编写于 作者: L linjintao

Merge branch 'ljt/add_docstring' into 'master'

Add docstring

See merge request open-mmlab/mmaction-lite!392
......@@ -81,10 +81,13 @@ class BaseRecognizer(nn.Module, metaclass=ABCMeta):
@abstractmethod
def forward_train(self, imgs, labels):
"""Defines the computation performed at every call when training."""
pass
@abstractmethod
def forward_test(self, imgs):
"""Defines the computation performed at every call
when evaluation and testing."""
pass
@staticmethod
......
......@@ -20,7 +20,8 @@ class Recognizer2D(BaseRecognizer):
return loss
def forward_test(self, imgs):
"""Defines the computation performed at every call when testing."""
"""Defines the computation performed at every call
when evaluation and testing."""
batches = imgs.shape[0]
imgs = imgs.reshape((-1, ) + imgs.shape[2:])
num_segs = imgs.shape[0] // batches
......
......@@ -18,7 +18,8 @@ class Recognizer3D(BaseRecognizer):
return loss
def forward_test(self, imgs):
"""Defines the computation performed at every call when testing."""
"""Defines the computation performed at every call
when evaluation and testing."""
imgs = imgs.reshape((-1, ) + imgs.shape[2:])
x = self.extract_feat(imgs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册