Take a look at:

  

      github.com/tensorflow/addons
  

  
    
  
    
  

  
    
      Add Modulated Deformable Convolution layer 3
    

    
      tensorflow:master ← Licht-T:add-deformable-conv
    

    
      
        opened 
        
          
        
        Oct 8, 2020
      
      

      
        
          
          Licht-T
        
      

      
        
          +2874
          -0
        
      
    
  


  
    # Description

This is the implementation of [Modulated Deformable Convolution…](https://arxiv.org/abs/1811.11168). This fixes #179. There is another PR #1129, but that is stale and contaminated by [unknown license codes](https://github.com/tensorflow/addons/pull/1129#issuecomment-662063946). So I re-implemented this which is based on [the Torchvision's implementation](https://github.com/pytorch/vision/pull/1586).

~~I knew this would be too big to get reviewed, so, at first, I made the CPU only kernel with Eigen. When the CPU kernel is good enough, I will move to the next step: the GPU kernel implementation.~~
**UPDATE: GPU kernel available!**

## Type of change

- [ ] Bug fix
- [ ] New Tutorial
- [ ] Updated or additional documentation
- [ ] Additional Testing
- [ ] New Activation and the changes conform to the [activation contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/activations/README.md#contribution-guidelines)
- [ ] New Callback and the changes conform to the [callback contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/callbacks/README.md#contribution-guidelines)
- [ ] New Image addition and the changes conform to the [image op contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/image/README.md#contribution-guidelines)
- [x] New Layer and the changes conform to the [layer contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/layers/README.md#contribution-guidelines)
- [ ] New Loss and the changes conform to the [loss contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/losses/README.md#contribution-guidelines)
- [ ] New Metric and the changes conform to the [metric contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/metrics/README.md#contribution-guidelines)
- [ ] New Optimizer and the changes conform to the [optimizer contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/optimizers/README.md#contribution-guidelines)
- [ ] New RNN Cell and the changes conform to the [rnn contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/rnn/README.md#contribution-guidelines)
- [ ] New Seq2seq addition and the changes conform to the [seq2seq contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/seq2seq/README.md#contribution-guidelines)
- [ ] New Text addition and the changes conform to the [text op contribution guidelines](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/text/README.md#contribution-guidelines)

# Checklist:

- [x] I've properly [formatted my code according to the guidelines](https://github.com/tensorflow/addons/blob/master/CONTRIBUTING.md#coding-style)
    - [ ] By running Black + Flake8
    - [x] By running pre-commit hooks
- [x] This PR addresses an already submitted issue for TensorFlow Addons
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] This PR contains modifications to C++ custom-ops

# How Has This Been Tested?
`pytest` unit-testing
  

  

  
    
    
  

  


More in general If you are interested in custom ops:

  
    
    
    Deformable convolution and other custom ops MLIR
  
  
    Recently we had a refresh over a Deformable convloution WIP PR in Addons. 
I’ve cherry-picked this as an example as this requires us to maintain almost 3k lines of new code in the repository. 
This is maintainer-ship overhead is also quite similar to what we have with other custom kernels PRs. 
As Addons is one of the few Ecosystem repositories to support custom (c++) ops and the related CI infra it is quite normal that we have this kind of proposed PRs. 
But as the codeownership of these compon…