Unverified Commit 1577f407 authored by ShawnHu's avatar ShawnHu Committed by GitHub
Browse files

Add type hints in mmcv/ops/active_rotated_filter.py (#2017)

* add typehints in ops-active-rotated-filter

* resolve typehints in ops-active-rotated-filter
parent 19902d89
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple
import torch import torch
from torch.autograd import Function from torch.autograd import Function
from torch.autograd.function import once_differentiable from torch.autograd.function import once_differentiable
...@@ -19,7 +21,8 @@ class ActiveRotatedFilterFunction(Function): ...@@ -19,7 +21,8 @@ class ActiveRotatedFilterFunction(Function):
""" """
@staticmethod @staticmethod
def forward(ctx, input, indices): def forward(ctx, input: torch.Tensor,
indices: torch.Tensor) -> torch.Tensor:
""" """
Args: Args:
input (torch.Tensor): Input features with shape input (torch.Tensor): Input features with shape
...@@ -41,7 +44,7 @@ class ActiveRotatedFilterFunction(Function): ...@@ -41,7 +44,7 @@ class ActiveRotatedFilterFunction(Function):
@staticmethod @staticmethod
@once_differentiable @once_differentiable
def backward(ctx, grad_out): def backward(ctx, grad_out: torch.Tensor) -> Tuple[torch.Tensor, None]:
""" """
Args: Args:
grad_output (torch.Tensor): The gradiant of output features grad_output (torch.Tensor): The gradiant of output features
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment