[tests] remove TF tests (uses of require_tf) (#38944)
* remove uses of require_tf * remove redundant import guards * this class has no tests * nits * del tf rng comment
This commit is contained in:
@@ -17,16 +17,13 @@ import unittest
|
||||
import numpy as np
|
||||
from parameterized import parameterized
|
||||
|
||||
from transformers.testing_utils import require_flax, require_tf, require_torch, require_vision
|
||||
from transformers.utils.import_utils import is_flax_available, is_tf_available, is_torch_available, is_vision_available
|
||||
from transformers.testing_utils import require_flax, require_torch, require_vision
|
||||
from transformers.utils.import_utils import is_flax_available, is_torch_available, is_vision_available
|
||||
|
||||
|
||||
if is_torch_available():
|
||||
import torch
|
||||
|
||||
if is_tf_available():
|
||||
import tensorflow as tf
|
||||
|
||||
if is_flax_available():
|
||||
import jax
|
||||
|
||||
@@ -122,20 +119,6 @@ class ImageTransformsTester(unittest.TestCase):
|
||||
self.assertTrue(np_img.min() == 0)
|
||||
self.assertTrue(np_img.max() == 1)
|
||||
|
||||
@require_tf
|
||||
def test_to_pil_image_from_tensorflow(self):
|
||||
# channels_first
|
||||
image = tf.random.uniform((3, 4, 5))
|
||||
pil_image = to_pil_image(image)
|
||||
self.assertIsInstance(pil_image, PIL.Image.Image)
|
||||
self.assertEqual(pil_image.size, (5, 4))
|
||||
|
||||
# channels_last
|
||||
image = tf.random.uniform((4, 5, 3))
|
||||
pil_image = to_pil_image(image)
|
||||
self.assertIsInstance(pil_image, PIL.Image.Image)
|
||||
self.assertEqual(pil_image.size, (5, 4))
|
||||
|
||||
@require_torch
|
||||
def test_to_pil_image_from_torch(self):
|
||||
# channels first
|
||||
|
||||
Reference in New Issue
Block a user