From a82a3274d2247a19cf0eafd8f565cefa4cf44c5a Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Tue, 20 Dec 2022 10:27:00 -0500 Subject: [PATCH] replace inspect.getargspec with inspect.signature Compatible with new Torch APIs --- senteval/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/senteval/utils.py b/senteval/utils.py index 425f60cd..c0529323 100644 --- a/senteval/utils.py +++ b/senteval/utils.py @@ -86,7 +86,7 @@ def get_optimizer(s): raise Exception('Unknown optimization method: "%s"' % method) # check that we give good parameters to the optimizer - expected_args = inspect.getargspec(optim_fn.__init__)[0] + parameters = list(inspect.signature(optim_fn.__init__).parameters) assert expected_args[:2] == ['self', 'params'] if not all(k in expected_args[2:] for k in optim_params.keys()): raise Exception('Unexpected parameters: expected "%s", got "%s"' % (