mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Revert "Fixes for CPython int/float tests (#155978)"
This reverts commit fab53dfdf1d89cecd5e82b12cced9b6dd217e87c. Reverted https://github.com/pytorch/pytorch/pull/155978 on behalf of https://github.com/guilhermeleobas due to failing in trunk ([comment](https://github.com/pytorch/pytorch/pull/155978#issuecomment-3019457531))
This commit is contained in:
@ -1277,12 +1277,6 @@ class BuiltinVariable(VariableTracker):
|
||||
if isinstance(args[0], ConstantVariable):
|
||||
return args[0].call_method(tx, name, args[1:], kwargs)
|
||||
|
||||
if self.fn is float and len(args) >= 1:
|
||||
if isinstance(args[0], ConstantVariable):
|
||||
return ConstantVariable.create(
|
||||
getattr(float, name)(args[0].as_python_constant())
|
||||
)
|
||||
|
||||
return super().call_method(tx, name, args, kwargs)
|
||||
|
||||
def _call_int_float(self, tx: "InstructionTranslator", arg):
|
||||
@ -2068,6 +2062,7 @@ class BuiltinVariable(VariableTracker):
|
||||
"assertNotWarns",
|
||||
"assertWarnsRegex",
|
||||
"assertDictEqual",
|
||||
"assertSequenceEqual",
|
||||
"assertWarns",
|
||||
)
|
||||
):
|
||||
|
Reference in New Issue
Block a user