[tests] further fix Tester object has no attribute '_testMethodName' (#35781)
* bug fix * update with more cases * more entries * Fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -29,7 +29,7 @@ if is_torchvision_available():
|
||||
from transformers import ViTImageProcessorFast
|
||||
|
||||
|
||||
class ViTImageProcessingTester(unittest.TestCase):
|
||||
class ViTImageProcessingTester:
|
||||
def __init__(
|
||||
self,
|
||||
parent,
|
||||
@@ -44,7 +44,6 @@ class ViTImageProcessingTester(unittest.TestCase):
|
||||
image_mean=[0.5, 0.5, 0.5],
|
||||
image_std=[0.5, 0.5, 0.5],
|
||||
):
|
||||
super().__init__()
|
||||
size = size if size is not None else {"height": 18, "width": 18}
|
||||
self.parent = parent
|
||||
self.batch_size = batch_size
|
||||
|
||||
@@ -30,7 +30,7 @@ if is_flax_available():
|
||||
from transformers.models.vit.modeling_flax_vit import FlaxViTForImageClassification, FlaxViTModel
|
||||
|
||||
|
||||
class FlaxViTModelTester(unittest.TestCase):
|
||||
class FlaxViTModelTester:
|
||||
def __init__(
|
||||
self,
|
||||
parent,
|
||||
@@ -72,7 +72,6 @@ class FlaxViTModelTester(unittest.TestCase):
|
||||
# in ViT, the seq length equals the number of patches + 1 (we add 1 for the [CLS] token)
|
||||
num_patches = (image_size // patch_size) ** 2
|
||||
self.seq_length = num_patches + 1
|
||||
super().__init__()
|
||||
|
||||
def prepare_config_and_inputs(self):
|
||||
pixel_values = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])
|
||||
|
||||
Reference in New Issue
Block a user