Revert "Fixes for CPython int/float tests (#155978)"

This reverts commit 23491519d288dedb2a54cfad5fef7fcb2ad8eade.

Reverted https://github.com/pytorch/pytorch/pull/155978 on behalf of https://github.com/XuehaiPan due to sys.get_int_max_str_digits is not always available ([comment](https://github.com/pytorch/pytorch/pull/155978#issuecomment-3021990027))
This commit is contained in:
PyTorch MergeBot
2025-07-01 06:16:49 +00:00
parent 754699610b
commit c202a7329a
78 changed files with 13 additions and 55 deletions

View File

@ -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",
)
):