File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -135,3 +135,27 @@ def test_load_pretrained_model():
135135
136136    assert  features .shape [- 1 ] ==  384   # DINOv2-S has embedding dimension of 384 
137137    assert  jnp .all (jnp .isfinite (features ))  # Check for NaN/Inf values 
138+ 
139+ 
140+ def  test_reduceformer ():
141+     """Test creation and inference of a ReduceFormer model.""" 
142+     key  =  jr .PRNGKey (42 )
143+ 
144+     x  =  jr .normal (key , (3 , 64 , 64 ))
145+     model  =  em .reduceformer_backbone_b1 (in_channels = 3 , num_classes = 10 , key = key )
146+     y_hat  =  model (x , key = key )
147+ 
148+     assert  len (y_hat ) ==  10 
149+ 
150+ 
151+ def  test_fused_reduceformer ():
152+     """Test creation and inference of a ReduceFormer model with fused mbconv.""" 
153+     key  =  jr .PRNGKey (42 )
154+ 
155+     x  =  jr .normal (key , (3 , 64 , 64 ))
156+     model  =  em .reduceformer_backbone_b1 (
157+         in_channels = 3 , num_classes = 10 , fuse_mbconv = True , key = key 
158+     )
159+     y_hat  =  model (x , key = key )
160+ 
161+     assert  len (y_hat ) ==  10 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments