Skip to content

Commit

Permalink
unittest - update deprecated self.assertEquals to self.assertEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
Chizkiyahu committed Nov 11, 2024
1 parent f1aafbc commit 41a4cb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _test_hessian_scores(self, hessian_info, target_nodes, repr_dataset, granula

info = hessian_info.fetch_hessian(request)
self.assertTrue(isinstance(info, dict))
self.assertEquals(set(info.keys()), {n.name for n in target_nodes})
self.assertEqual(set(info.keys()), {n.name for n in target_nodes})
for target_node in target_nodes:
node_score = info[target_node.name]
kernel_attr_name = [w for w in target_node.weights if KERNEL in w]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ def test_adding_holder_instead_quantize_wrapper(self):
activation_quantization_holders_in_model = self._get_holders_with_validation(gptq_model, exp_n_holders=3)
for a in activation_quantization_holders_in_model:
self.assertTrue(isinstance(a.activation_holder_quantizer, STESymmetricActivationTrainableQuantizer))
self.assertEquals(a.activation_holder_quantizer.identifier, TrainingMethod.STE)
self.assertEqual(a.activation_holder_quantizer.identifier, TrainingMethod.STE)
# activation quantization params for gptq should be frozen (non-learnable)
self.assertTrue(a.activation_holder_quantizer.freeze_quant_params is True)
self.assertEquals(a.activation_holder_quantizer.get_trainable_variables(VariableGroup.QPARAMS), [])
self.assertEqual(a.activation_holder_quantizer.get_trainable_variables(VariableGroup.QPARAMS), [])

for name, module in gptq_model.named_modules():
if isinstance(module, PytorchQuantizationWrapper):
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_adding_holder_with_gradual_act_quantization(self):
quantizer = a.activation_holder_quantizer.quantizer
self.assertTrue(isinstance(quantizer, STESymmetricActivationTrainableQuantizer))
self.assertTrue(quantizer.freeze_quant_params is True)
self.assertEquals(quantizer.get_trainable_variables(VariableGroup.QPARAMS), [])
self.assertEqual(quantizer.get_trainable_variables(VariableGroup.QPARAMS), [])

def _get_holders_with_validation(self, gptq_model, exp_n_holders):
last_module = list(gptq_model.named_modules())[-1][1]
Expand Down

0 comments on commit 41a4cb3

Please sign in to comment.