@@ -572,14 +572,14 @@ def test_rms_norm_partition_specs_constraint(self, mock_with_sharding_constraint
572572
573573 # 1. Input tensor constraint.
574574 input_spec = calls [0 ].args [1 ]
575- self .assertEqual (input_spec , ("fsdp" , "model" , None ))
575+ self .assertEqual (tuple ( input_spec ) , ("fsdp" , "model" , None ))
576576 self .assertEqual (calls [0 ].args [0 ].shape , (2 , 3 , dim ))
577577 self .assertEqual (calls [0 ].args [0 ].dtype , jnp .float32 )
578578 np .testing .assert_array_equal (calls [0 ].args [0 ], inputs )
579579
580580 # 2. Output tensor constraint.
581581 output_spec = calls [1 ].args [1 ]
582- self .assertEqual (output_spec , ("fsdp" , None , None ))
582+ self .assertEqual (tuple ( output_spec ) , ("fsdp" , None , None ))
583583 self .assertEqual (calls [1 ].args [0 ].shape , (2 , 3 , dim ))
584584 self .assertEqual (calls [1 ].args [0 ].dtype , jnp .float32 )
585585 np .testing .assert_array_equal (calls [1 ].args [0 ], outputs )
@@ -1462,21 +1462,21 @@ def test_embed_partition_specs_constraint(self, mock_with_sharding_constraint):
14621462
14631463 # 1. Input activation constraint (indices tensor).
14641464 input_spec = calls [0 ].args [1 ]
1465- self .assertEqual (input_spec , ("fsdp" , None ))
1465+ self .assertEqual (tuple ( input_spec ) , ("fsdp" , None ))
14661466 self .assertEqual (calls [0 ].args [0 ].shape , (3 , seq_len ))
14671467 self .assertEqual (calls [0 ].args [0 ].dtype , jnp .int32 )
14681468 np .testing .assert_array_equal (calls [0 ].args [0 ], ixs )
14691469
14701470 # 2. Embedding weight constraint.
14711471 weight_spec = calls [1 ].args [1 ]
1472- self .assertEqual (weight_spec , ("model" , "fsdp" ))
1472+ self .assertEqual (tuple ( weight_spec ) , ("model" , "fsdp" ))
14731473 self .assertEqual (calls [1 ].args [0 ].shape , (num_embeddings , dim ))
14741474 self .assertEqual (calls [1 ].args [0 ].dtype , jnp .float32 )
14751475 np .testing .assert_array_equal (calls [1 ].args [0 ], state ["weight" ])
14761476
14771477 # 3. Output activation constraint (after lookup).
14781478 output_spec = calls [2 ].args [1 ]
1479- self .assertEqual (output_spec , ("fsdp" , "model" ))
1479+ self .assertEqual (tuple ( output_spec ) , ("fsdp" , "model" ))
14801480 self .assertEqual (calls [2 ].args [0 ].shape , (3 , seq_len , dim ))
14811481 self .assertEqual (calls [2 ].args [0 ].dtype , jnp .float32 )
14821482 np .testing .assert_array_equal (calls [2 ].args [0 ], actual_embeds )
0 commit comments