Check kernel against function schema in c10 op registration (#18256)
authorSebastian Messmer <messmer@fb.com>
Sat, 30 Mar 2019 07:03:44 +0000 (00:03 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 30 Mar 2019 07:07:22 +0000 (00:07 -0700)
commit14c28fabd23c92d120544e8d5434b38efda2e7dc
tree79335dce82bb92f74ce2bcd17357ccb0d01565b5
parentc4bb09cc42069412fa9f4f1ff033ad4696c5e6db
Check kernel against function schema in c10 op registration (#18256)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18256

This diff infers the function schema from the kernel function/functor and checks that it matches the specified function schema.

This diff does not allow (yet) to omit specifying the function schema in the registration API. That will come in a future diff.

Reviewed By: dzhulgakov

Differential Revision: D14552738

fbshipit-source-id: 00202b489ede19f26ae686c97416b38c72c11532
aten/src/ATen/core/op_registration/base.h
aten/src/ATen/core/op_registration/infer_schema.cpp [new file with mode: 0644]
aten/src/ATen/core/op_registration/infer_schema.h
aten/src/ATen/core/op_registration/kernel_function_test.cpp
aten/src/ATen/core/op_registration/kernel_functor.h
aten/src/ATen/core/op_registration/kernel_functor_test.cpp
aten/src/ATen/core/op_registration/kernel_stackbased.h
aten/src/ATen/core/op_registration/op_registration.h
c10/util/C++17.h
c10/util/TypeTraits.h
caffe2/operators/experimental/c10/cpu/concat_cpu.cc