Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Refactor the interface for RoIAlignRotated #1662

Merged
merged 6 commits into from
Feb 18, 2022

Conversation

nijkah
Copy link
Contributor

@nijkah nijkah commented Jan 12, 2022

Motivation

RoIAlignRotated does not have the same interface as RoIAlign.

Modification

I edited its interface and added deprecated warning.

@CLAassistant
Copy link

CLAassistant commented Jan 12, 2022

CLA assistant check
All committers have signed the CLA.

@zhouzaida
Copy link
Collaborator

Hi @nijkah , thanks for your contribution. LGTM. BTW, it would be better to add a unit test for the renaming behavior. https://github.com/open-mmlab/mmcv/blob/master/tests/test_ops/test_roi_align_rotated.py

@nijkah
Copy link
Contributor Author

nijkah commented Jan 18, 2022

@zhouzaida Actually, I'm not familiar with a unit test. What is the best convention to test this kind of behavior?
Should I define new function like (def _test_roialign_rotated_deprecated_parameters) or just add new forward & backward with new & deprecated parameters under the function _test_roialign_rotated_allclose?

@zhouzaida
Copy link
Collaborator

@zhouzaida Actually, I'm not familiar with a unit test. What is the best convention to test this kind of behavior? Should I define new function like (def _test_roialign_rotated_deprecated_parameters) or just add new forward & backward with new & deprecated parameters under the function _test_roialign_rotated_allclose?

The former way may be better.

@zhouzaida zhouzaida changed the title fix interface for RoIAlignRotated [Refactor] Refactor the interface for RoIAlignRotated Jan 18, 2022
@nijkah
Copy link
Contributor Author

nijkah commented Jan 19, 2022

@zhouzaida Can you check the test code? Is the code you intended?

@zhouzaida
Copy link
Collaborator

@zhouzaida Actually, I'm not familiar with a unit test. What is the best convention to test this kind of behavior? Should I define new function like (def _test_roialign_rotated_deprecated_parameters) or just add new forward & backward with new & deprecated parameters under the function _test_roialign_rotated_allclose?

Maybe the latter will be more concise. 🤣

@nijkah
Copy link
Contributor Author

nijkah commented Jan 19, 2022

@zhouzaida
Function _test_roialign_rotated_allclose tests the roi_align_rotated function not RoIAlignRotated Module.
Although function _test_roialign_rotated_gradcheck uses RoIAlignRotated Module, but it might seem odd to test deprecated parameters in that function.
Any suggestion? I am sorry to bother you. :(

@zhouzaida
Copy link
Collaborator

zhouzaida commented Jan 19, 2022

@zhouzaida Function _test_roialign_rotated_allclose tests the roi_align_rotated function not RoIAlignRotated Module. Although function _test_roialign_rotated_gradcheck uses RoIAlignRotated Module, but it might seem odd to test deprecated parameters in that function. Any suggestion? I am sorry to bother you. :(

Yet, we just need to test the deprecated parameters in _test_roialign_rotated_allclose.

@nijkah
Copy link
Contributor Author

nijkah commented Jan 19, 2022

Option 1. Replace roi_align_rotated function with RoIAlignRotated Module in the _test_roialign_rotated_allclose.
Option 2. Just add a test code for RoIAlignRotated Module after for loop of _test_roialign_rotated_allclose like below

  for case, output in zip(inputs, outputs):
        np_input = np.array(case[0])
        np_rois = np.array(case[1])
        np_output = np.array(output[0])
        np_grad = np.array(output[1])
        x = torch.tensor(
            np_input, dtype=dtype, device=device, requires_grad=True)
        rois = torch.tensor(np_rois, dtype=dtype, device=device)
        output = roi_align_rotated(x, rois, (pool_h, pool_w), spatial_scale,
                                   sampling_ratio, True)
        output.backward(torch.ones_like(output))
        assert np.allclose(
            output.data.type(torch.float).cpu().numpy(), np_output, atol=1e-3)
        assert np.allclose(
            x.grad.data.type(torch.float).cpu().numpy(), np_grad, atol=1e-3)

  # end of original function

  roi_align_rotated_module_deprecated = RoIAlignRotated(
      out_size=(pool_h, pool_w),
      spatial_scale=spatial_scale,
      sample_num=sampling_ratio)

  output_v1 = roi_align_rotated_module_deprecated(x, rois)

  roi_align_rotated_module_new = RoIAlignRotated(
      output_size=(pool_h, pool_w),
      spatial_scale=spatial_scale,
      sampling_ratio=sampling_ratio)

  output_v2 = roi_align_rotated_module_new(x, rois)
  ssert np.allclose(
            output_v1.data.type(torch.float).cpu().numpy(),
            output_v2.data.type(torch.float).cpu().numpy())

@zhouzaida
Copy link
Collaborator

Option 1. Replace roi_align_rotated function with RoIAlignRotated Module in the _test_roialign_rotated_allclose. Option 2. Just add a test code for RoIAlignRotated Module after for loop of _test_roialign_rotated_allclose like below

  for case, output in zip(inputs, outputs):
        np_input = np.array(case[0])
        np_rois = np.array(case[1])
        np_output = np.array(output[0])
        np_grad = np.array(output[1])
        x = torch.tensor(
            np_input, dtype=dtype, device=device, requires_grad=True)
        rois = torch.tensor(np_rois, dtype=dtype, device=device)
        output = roi_align_rotated(x, rois, (pool_h, pool_w), spatial_scale,
                                   sampling_ratio, True)
        output.backward(torch.ones_like(output))
        assert np.allclose(
            output.data.type(torch.float).cpu().numpy(), np_output, atol=1e-3)
        assert np.allclose(
            x.grad.data.type(torch.float).cpu().numpy(), np_grad, atol=1e-3)

  # end of original function

  roi_align_rotated_module_deprecated = RoIAlignRotated(
      out_size=(pool_h, pool_w),
      spatial_scale=spatial_scale,
      sample_num=sampling_ratio)

  output_v1 = roi_align_rotated_module_deprecated(x, rois)

  roi_align_rotated_module_new = RoIAlignRotated(
      output_size=(pool_h, pool_w),
      spatial_scale=spatial_scale,
      sampling_ratio=sampling_ratio)

  output_v2 = roi_align_rotated_module_new(x, rois)
  ssert np.allclose(
            output_v1.data.type(torch.float).cpu().numpy(),
            output_v2.data.type(torch.float).cpu().numpy())

Option2 would be fine.

@zhouzaida
Copy link
Collaborator

Should we also refactor the interface of forward?

@zhouzaida zhouzaida added the WIP label Jan 24, 2022
@nijkah
Copy link
Contributor Author

nijkah commented Jan 25, 2022

@zhouzaida Do you mean forward of RoIAlignRotatedFunction class? I think it will be desirable to understand the interface.
If you add emoji to this comment, I will edit it.

@zhouzaida
Copy link
Collaborator

zhouzaida commented Jan 27, 2022

@zhouzaida Do you mean forward of RoIAlignRotatedFunction class? I think it will be desirable to understand the interface. If you add emoji to this comment, I will edit it.

Got it. BTW, we also need to update the docstring.
image

@nijkah
Copy link
Contributor Author

nijkah commented Jan 28, 2022

@zhouzaida Do you mean forward of RoIAlignRotatedFunction class? I think it will be desirable to understand the interface. If you add emoji to this comment, I will edit it.

Got it. BTW, we also need to update the docstring. image

I edited docstring.
And I also edited cuda and cpu interfaces to refactor the RoIAlignRotatedFunction.

@zhouzaida
Copy link
Collaborator

Please @luopeichao have a look.

@nijkah
Copy link
Contributor Author

nijkah commented Feb 16, 2022

What should I do else for the next step? @zhouzaida

@zhouzaida
Copy link
Collaborator

What should I do else for the next step? @zhouzaida

Thanks for your contribution. I will merge the PR in a few days.

@zhouzaida zhouzaida requested a review from ZwwWayne February 16, 2022 13:44
@nijkah
Copy link
Contributor Author

nijkah commented Feb 18, 2022

@zhouzaida
Thanks for your reply. I apologize if I made you hurry. 😔
I just wished this PR will be merged soon since it makes mmdetection code for rotated objects messy.

@luopeichao
Copy link
Contributor

Looks good to me about parrots extension changes.

@zhouzaida zhouzaida removed the WIP label Feb 18, 2022
@zhouzaida
Copy link
Collaborator

zhouzaida commented Feb 18, 2022

@zhouzaida Thanks for your reply. I apologize if I made you hurry. 😔 I just wished this PR will be merged soon since it makes mmdetection code for rotated objects messy.

Thanks for your contribution. I will merge the PR today.

@zhouzaida zhouzaida merged commit b83bdb0 into open-mmlab:master Feb 18, 2022
ZwwWayne pushed a commit that referenced this pull request Feb 21, 2022
* Support deepcopy for Config (#1658)

* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments

* [Feature] Add spconv ops from mmdet3d (#1581)

* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in #1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>

* Imporve the docstring of imfrombytes and fix a deprecation-warning (#1731)

* [Refactor] Refactor the interface for RoIAlignRotated (#1662)

* fix interface for RoIAlignRotated

* Add a unit test for RoIAlignRotated

* Make a unit test for RoIAlignRotated concise

* fix interface for RoIAlignRotated

* Refactor ext_module.nms_rotated

* Lint cpp files

* add transforms

* add invoking time check for cacheable methods

* fix lint

* add unittest

* fix bug in non-strict input mapping

* fix ci

* fix ci

* fix compatibility with python<3.9

* fix typing compatibility

* fix import

* fix typing

* add alternative for nullcontext

* fix import

* fix import

* add docstrings

* add docstrings

* fix callable check

* resolve comments

* fix lint

* enrich unittest cases

* fix lint

* fix unittest

Co-authored-by: Ma Zerun <[email protected]>
Co-authored-by: Wenhao Wu <[email protected]>
Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>
Co-authored-by: Jiazhen Wang <[email protected]>
Co-authored-by: Hakjin Lee <[email protected]>
ZwwWayne pushed a commit that referenced this pull request Feb 24, 2022
* Support deepcopy for Config (#1658)

* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments

* [Feature] Add spconv ops from mmdet3d (#1581)

* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in #1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>

* Imporve the docstring of imfrombytes and fix a deprecation-warning (#1731)

* [Refactor] Refactor the interface for RoIAlignRotated (#1662)

* fix interface for RoIAlignRotated

* Add a unit test for RoIAlignRotated

* Make a unit test for RoIAlignRotated concise

* fix interface for RoIAlignRotated

* Refactor ext_module.nms_rotated

* Lint cpp files

* add transforms

* add invoking time check for cacheable methods

* fix lint

* add unittest

* fix bug in non-strict input mapping

* fix ci

* fix ci

* fix compatibility with python<3.9

* fix typing compatibility

* fix import

* fix typing

* add alternative for nullcontext

* fix import

* fix import

* add docstrings

* add docstrings

* fix callable check

* resolve comments

* fix lint

* enrich unittest cases

* fix lint

* fix unittest

Co-authored-by: Ma Zerun <[email protected]>
Co-authored-by: Wenhao Wu <[email protected]>
Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>
Co-authored-by: Jiazhen Wang <[email protected]>
Co-authored-by: Hakjin Lee <[email protected]>
ZwwWayne pushed a commit to ZwwWayne/mmcv that referenced this pull request Apr 28, 2022
* Support deepcopy for Config (open-mmlab#1658)

* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments

* [Feature] Add spconv ops from mmdet3d (open-mmlab#1581)

* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in open-mmlab#1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>

* Imporve the docstring of imfrombytes and fix a deprecation-warning (open-mmlab#1731)

* [Refactor] Refactor the interface for RoIAlignRotated (open-mmlab#1662)

* fix interface for RoIAlignRotated

* Add a unit test for RoIAlignRotated

* Make a unit test for RoIAlignRotated concise

* fix interface for RoIAlignRotated

* Refactor ext_module.nms_rotated

* Lint cpp files

* add transforms

* add invoking time check for cacheable methods

* fix lint

* add unittest

* fix bug in non-strict input mapping

* fix ci

* fix ci

* fix compatibility with python<3.9

* fix typing compatibility

* fix import

* fix typing

* add alternative for nullcontext

* fix import

* fix import

* add docstrings

* add docstrings

* fix callable check

* resolve comments

* fix lint

* enrich unittest cases

* fix lint

* fix unittest

Co-authored-by: Ma Zerun <[email protected]>
Co-authored-by: Wenhao Wu <[email protected]>
Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>
Co-authored-by: Jiazhen Wang <[email protected]>
Co-authored-by: Hakjin Lee <[email protected]>
@nijkah nijkah deleted the fix/roi_align_rotated branch June 2, 2022 05:59
zhouzaida pushed a commit that referenced this pull request Jul 19, 2022
* Support deepcopy for Config (#1658)

* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments

* [Feature] Add spconv ops from mmdet3d (#1581)

* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in #1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>

* Imporve the docstring of imfrombytes and fix a deprecation-warning (#1731)

* [Refactor] Refactor the interface for RoIAlignRotated (#1662)

* fix interface for RoIAlignRotated

* Add a unit test for RoIAlignRotated

* Make a unit test for RoIAlignRotated concise

* fix interface for RoIAlignRotated

* Refactor ext_module.nms_rotated

* Lint cpp files

* add transforms

* add invoking time check for cacheable methods

* fix lint

* add unittest

* fix bug in non-strict input mapping

* fix ci

* fix ci

* fix compatibility with python<3.9

* fix typing compatibility

* fix import

* fix typing

* add alternative for nullcontext

* fix import

* fix import

* add docstrings

* add docstrings

* fix callable check

* resolve comments

* fix lint

* enrich unittest cases

* fix lint

* fix unittest

Co-authored-by: Ma Zerun <[email protected]>
Co-authored-by: Wenhao Wu <[email protected]>
Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>
Co-authored-by: Jiazhen Wang <[email protected]>
Co-authored-by: Hakjin Lee <[email protected]>
zhouzaida pushed a commit that referenced this pull request Jul 31, 2022
* Support deepcopy for Config (#1658)

* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments

* [Feature] Add spconv ops from mmdet3d (#1581)

* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in #1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>

* Imporve the docstring of imfrombytes and fix a deprecation-warning (#1731)

* [Refactor] Refactor the interface for RoIAlignRotated (#1662)

* fix interface for RoIAlignRotated

* Add a unit test for RoIAlignRotated

* Make a unit test for RoIAlignRotated concise

* fix interface for RoIAlignRotated

* Refactor ext_module.nms_rotated

* Lint cpp files

* add transforms

* add invoking time check for cacheable methods

* fix lint

* add unittest

* fix bug in non-strict input mapping

* fix ci

* fix ci

* fix compatibility with python<3.9

* fix typing compatibility

* fix import

* fix typing

* add alternative for nullcontext

* fix import

* fix import

* add docstrings

* add docstrings

* fix callable check

* resolve comments

* fix lint

* enrich unittest cases

* fix lint

* fix unittest

Co-authored-by: Ma Zerun <[email protected]>
Co-authored-by: Wenhao Wu <[email protected]>
Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>
Co-authored-by: Jiazhen Wang <[email protected]>
Co-authored-by: Hakjin Lee <[email protected]>
zhouzaida pushed a commit that referenced this pull request Jul 31, 2022
* Support deepcopy for Config (#1658)

* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments

* [Feature] Add spconv ops from mmdet3d (#1581)

* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in #1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>

* Imporve the docstring of imfrombytes and fix a deprecation-warning (#1731)

* [Refactor] Refactor the interface for RoIAlignRotated (#1662)

* fix interface for RoIAlignRotated

* Add a unit test for RoIAlignRotated

* Make a unit test for RoIAlignRotated concise

* fix interface for RoIAlignRotated

* Refactor ext_module.nms_rotated

* Lint cpp files

* add transforms

* add invoking time check for cacheable methods

* fix lint

* add unittest

* fix bug in non-strict input mapping

* fix ci

* fix ci

* fix compatibility with python<3.9

* fix typing compatibility

* fix import

* fix typing

* add alternative for nullcontext

* fix import

* fix import

* add docstrings

* add docstrings

* fix callable check

* resolve comments

* fix lint

* enrich unittest cases

* fix lint

* fix unittest

Co-authored-by: Ma Zerun <[email protected]>
Co-authored-by: Wenhao Wu <[email protected]>
Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>
Co-authored-by: Jiazhen Wang <[email protected]>
Co-authored-by: Hakjin Lee <[email protected]>
zhouzaida pushed a commit to zhouzaida/mmcv that referenced this pull request Aug 1, 2022
* Support deepcopy for Config (open-mmlab#1658)

* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments

* [Feature] Add spconv ops from mmdet3d (open-mmlab#1581)

* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in open-mmlab#1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>

* Imporve the docstring of imfrombytes and fix a deprecation-warning (open-mmlab#1731)

* [Refactor] Refactor the interface for RoIAlignRotated (open-mmlab#1662)

* fix interface for RoIAlignRotated

* Add a unit test for RoIAlignRotated

* Make a unit test for RoIAlignRotated concise

* fix interface for RoIAlignRotated

* Refactor ext_module.nms_rotated

* Lint cpp files

* add transforms

* add invoking time check for cacheable methods

* fix lint

* add unittest

* fix bug in non-strict input mapping

* fix ci

* fix ci

* fix compatibility with python<3.9

* fix typing compatibility

* fix import

* fix typing

* add alternative for nullcontext

* fix import

* fix import

* add docstrings

* add docstrings

* fix callable check

* resolve comments

* fix lint

* enrich unittest cases

* fix lint

* fix unittest

Co-authored-by: Ma Zerun <[email protected]>
Co-authored-by: Wenhao Wu <[email protected]>
Co-authored-by: hdc <[email protected]>
Co-authored-by: grimoire <[email protected]>
Co-authored-by: Jiazhen Wang <[email protected]>
Co-authored-by: Hakjin Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants