From: Gregory Chanan Date: Wed, 13 Mar 2019 22:07:49 +0000 (-0700) Subject: Remove AssertNDim, which doesn't seem to be used. X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~826 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5b50a3440f6bf2c503a3f06e8e5b4b4f66f60ad;p=platform%2Fupstream%2Fpytorch.git Remove AssertNDim, which doesn't seem to be used. Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17978 Reviewed By: colesbury Differential Revision: D14438845 Pulled By: gchanan fbshipit-source-id: 106650c37fb1885201eaef27cb6d86b49ef27976 --- diff --git a/tools/cwrap/plugins/AssertNDim.py b/tools/cwrap/plugins/AssertNDim.py deleted file mode 100644 index 599a067..0000000 --- a/tools/cwrap/plugins/AssertNDim.py +++ /dev/null @@ -1,29 +0,0 @@ -from . import CWrapPlugin -from string import Template - - -class AssertNDim(CWrapPlugin): - - PRE_CODE_TEMPLATE = Template( - """if(THTensor_(nDimensionLegacyNoScalars)(LIBRARY_STATE ${arg_op}) != ${dim_value}) { - THError("Expected argument %s to have %d dimension(s), but has %d", - "${op}", ${dim_value}, THTensor_(nDimensionLegacyNoScalars)(LIBRARY_STATE ${arg_op})); - } - """) - - def process_option_code_template(self, template, option): - new_code_pre = [] - - for _, arg in enumerate(option['arguments']): - if 'assert_ndim' not in arg: - continue - - dim_value = arg.get('assert_ndim') - op = arg.get('assign_name', arg['name']) - arg_op = "arg_" + op - new_code_pre.append(self.PRE_CODE_TEMPLATE.substitute(op=op, - arg_op=arg_op, - dim_value=dim_value)) - template = new_code_pre + template - - return template