


"""simple docstring"""





from __future__ import annotations

import inspect
import unittest
from math import floor

import numpy as np

from transformers import CvtConfig
from transformers.testing_utils import require_tf, require_vision, slow
from transformers.utils import cached_property, is_tf_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
 import tensorflow as tf

 from transformers import TFCvtForImageClassification, TFCvtModel
 from transformers.models.cvt.modeling_tf_cvt import TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
 from PIL import Image

 from transformers import AutoImageProcessor



class 						snake_case_(				a__	):






     def    lowerCamelCase__   (		self     :    Union[str, Any] ):
           lowerCAmelCase    :		int				=      self.config_class(**self.inputs_dict )
           self.parent.assertTrue(hasattr(UpperCamelCase_    , '''embed_dim''' ) )
           self.parent.assertTrue(hasattr(UpperCamelCase_    , '''num_heads''' ) )



class 						snake_case_:






     def __init__(		self     :    List[Any]    , UpperCamelCase_     :    List[str]    , UpperCamelCase_     :    int=1_3    , UpperCamelCase_     :    str=6_4    , UpperCamelCase_     :    Tuple=3    , UpperCamelCase_     :    int=[1_6, 4_8, 9_6]    , UpperCamelCase_     :    Any=[1, 3, 6]    , UpperCamelCase_     :    Union[str, Any]=[1, 2, 1_0]    , UpperCamelCase_     :    int=[7, 3, 3]    , UpperCamelCase_     :    Optional[Any]=[4, 2, 2]    , UpperCamelCase_     :    Optional[Any]=[2, 1, 1]    , UpperCamelCase_     :    Optional[Any]=[2, 2, 2]    , UpperCamelCase_     :    Any=[False, False, True]    , UpperCamelCase_     :    Optional[Any]=[0.0, 0.0, 0.0]    , UpperCamelCase_     :    Any=0.02    , UpperCamelCase_     :    Union[str, Any]=1E-12    , UpperCamelCase_     :    List[Any]=True    , UpperCamelCase_     :    int=True    , UpperCamelCase_     :    Optional[Any]=2    , ):
           lowerCAmelCase    :		Dict				=      parent
           lowerCAmelCase    :		Optional[Any]				=      batch_size
           lowerCAmelCase    :		Optional[int]				=      image_size
           lowerCAmelCase    :		Any				=      patch_sizes
           lowerCAmelCase    :		Dict				=      patch_stride
           lowerCAmelCase    :		Optional[Any]				=      patch_padding
           lowerCAmelCase    :		str				=      is_training
           lowerCAmelCase    :		List[Any]				=      use_labels
           lowerCAmelCase    :		Optional[Any]				=      num_labels
           lowerCAmelCase    :		Optional[int]				=      num_channels
           lowerCAmelCase    :		Union[str, Any]				=      embed_dim
           lowerCAmelCase    :		List[Any]				=      num_heads
           lowerCAmelCase    :		Optional[int]				=      stride_kv
           lowerCAmelCase    :		Tuple				=      depth
           lowerCAmelCase    :		str				=      cls_token
           lowerCAmelCase    :		str				=      attention_drop_rate
           lowerCAmelCase    :		Optional[int]				=      initializer_range
           lowerCAmelCase    :		Union[str, Any]				=      layer_norm_eps






     def    lowerCamelCase__   (		self     :    str ):
           lowerCAmelCase    :		Any				=      floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size] )

           lowerCAmelCase    :		Tuple				=      None
           if self.use_labels:
                 # create a random int32 tensor of given shape
                 lowerCAmelCase    :		Tuple				=      ids_tensor([self.batch_size]    , self.num_labels )

           lowerCAmelCase    :		Any				=      self.get_config()
           return config, pixel_values, labels






     def    lowerCamelCase__   (		self     :    str ):
           return CvtConfig(
               image_size=self.image_size    , num_labels=self.num_labels    , num_channels=self.num_channels    , embed_dim=self.embed_dim    , num_heads=self.num_heads    , patch_sizes=self.patch_sizes    , patch_padding=self.patch_padding    , patch_stride=self.patch_stride    , stride_kv=self.stride_kv    , depth=self.depth    , cls_token=self.cls_token    , attention_drop_rate=self.attention_drop_rate    , initializer_range=self.initializer_range    , )






     def    lowerCamelCase__   (		self     :    Dict    , UpperCamelCase_     :    Any    , UpperCamelCase_     :    int    , UpperCamelCase_     :    List[str] ):
           lowerCAmelCase    :		Any				=      TFCvtModel(config=UpperCamelCase_ )
           lowerCAmelCase    :		List[str]				=      model(UpperCamelCase_    , training=UpperCamelCase_ )
           lowerCAmelCase    :		List[str]				=      (self.image_size, self.image_size)
           lowerCAmelCase,					lowerCAmelCase    :		List[str]				=      image_size[0], image_size[1]
           for i in range(len(self.depth ) ):
                 lowerCAmelCase    :		Optional[Any]				=      floor(((height + 2 * self.patch_padding[i] - self.patch_sizes[i]) / self.patch_stride[i]) + 1 )
                 lowerCAmelCase    :		Optional[int]				=      floor(((width + 2 * self.patch_padding[i] - self.patch_sizes[i]) / self.patch_stride[i]) + 1 )
           self.parent.assertEqual(result.last_hidden_state.shape    , (self.batch_size, self.embed_dim[-1], height, width) )






     def    lowerCamelCase__   (		self     :    int    , UpperCamelCase_     :    Optional[int]    , UpperCamelCase_     :    Tuple    , UpperCamelCase_     :    Optional[Any] ):
           lowerCAmelCase    :		Optional[Any]				=      self.num_labels
           lowerCAmelCase    :		Any				=      TFCvtForImageClassification(UpperCamelCase_ )
           lowerCAmelCase    :		Union[str, Any]				=      model(UpperCamelCase_    , labels=UpperCamelCase_    , training=UpperCamelCase_ )
           self.parent.assertEqual(result.logits.shape    , (self.batch_size, self.num_labels) )






     def    lowerCamelCase__   (		self     :    Optional[int] ):
           lowerCAmelCase    :		List[Any]				=      self.prepare_config_and_inputs()
           lowerCAmelCase,					lowerCAmelCase,					lowerCAmelCase    :		List[Any]				=      config_and_inputs
           lowerCAmelCase    :		List[Any]				=      {'''pixel_values''': pixel_values}
           return config, inputs_dict



@require_tf
class 						snake_case_(				a__							,    a__							,    unittest.TestCase	):
     __UpperCamelCase     =    (TFCvtModel, TFCvtForImageClassification) if is_tf_available() else ()
     __UpperCamelCase     =    (
         {'''feature-extraction''': TFCvtModel, '''image-classification''': TFCvtForImageClassification}
         if is_tf_available()
         else {}
     )
     __UpperCamelCase     =    False
     __UpperCamelCase     =    False
     __UpperCamelCase     =    False
     __UpperCamelCase     =    False
     __UpperCamelCase     =    False






     def    lowerCamelCase__   (		self     :    Optional[int] ):
           lowerCAmelCase    :		str				=      TFCvtModelTester(self )
           lowerCAmelCase    :		Tuple				=      TFCvtConfigTester(self    , config_class=UpperCamelCase_    , has_text_modality=UpperCamelCase_    , hidden_size=3_7 )






     def    lowerCamelCase__   (		self     :    List[str] ):
           self.config_tester.create_and_test_config_common_properties()
           self.config_tester.create_and_test_config_to_json_string()
           self.config_tester.create_and_test_config_to_json_file()
           self.config_tester.create_and_test_config_from_and_save_pretrained()
           self.config_tester.create_and_test_config_with_num_labels()
           self.config_tester.check_config_can_be_init_without_params()
           self.config_tester.check_config_arguments_init()






     @unittest.skip(reason='''Cvt does not output attentions''' )
     def    lowerCamelCase__   (		self     :    Optional[Any] ):
           pass






     @unittest.skip(reason='''Cvt does not use inputs_embeds''' )
     def    lowerCamelCase__   (		self     :    List[str] ):
           pass






     @unittest.skip(reason='''Cvt does not support input and output embeddings''' )
     def    lowerCamelCase__   (		self     :    Dict ):
           pass






     @unittest.skipIf(
         not is_tf_available() or len(tf.config.list_physical_devices('''GPU''' ) ) == 0    , reason='''TF does not support backprop for grouped convolutions on CPU.'''    , )
     def    lowerCamelCase__   (		self     :    List[str] ):
           super().test_dataset_conversion()






     @unittest.skipIf(
         not is_tf_available() or len(tf.config.list_physical_devices('''GPU''' ) ) == 0    , reason='''TF does not support backprop for grouped convolutions on CPU.'''    , )
     @slow
     def    lowerCamelCase__   (		self     :    Union[str, Any] ):
           super().test_keras_fit()






     @unittest.skip(reason='''Get `Failed to determine best cudnn convolution algo.` error after using TF 2.12+cuda 11.8''' )
     def    lowerCamelCase__   (		self     :    List[Any] ):
           lowerCAmelCase    :		Dict				=      tf.keras.mixed_precision.Policy('''mixed_float16''' )
           tf.keras.mixed_precision.set_global_policy(UpperCamelCase_ )
           super().test_keras_fit()
           tf.keras.mixed_precision.set_global_policy('''float32''' )






     def    lowerCamelCase__   (		self     :    Optional[int] ):
           lowerCAmelCase,					lowerCAmelCase    :		Optional[Any]				=      self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                 lowerCAmelCase    :		str				=      model_class(UpperCamelCase_ )
                 lowerCAmelCase    :		Union[str, Any]				=      inspect.signature(model.call )
                 # signature.parameters is an OrderedDict => so arg_names order is deterministic
                 lowerCAmelCase    :		List[Any]				=      [*signature.parameters.keys()]

                 lowerCAmelCase    :		List[Any]				=      ['''pixel_values''']
                 self.assertListEqual(arg_names[:1]    , UpperCamelCase_ )






     def    lowerCamelCase__   (		self     :    Union[str, Any] ):
           def check_hidden_states_output(UpperCamelCase_     :    Union[str, Any]    , UpperCamelCase_     :    List[str]    , UpperCamelCase_     :    str ):
                 lowerCAmelCase    :		Optional[Any]				=      model_class(UpperCamelCase_ )

                 lowerCAmelCase    :		Union[str, Any]				=      model(**self._prepare_for_class(UpperCamelCase_    , UpperCamelCase_ ) )
                 lowerCAmelCase    :		int				=      outputs.hidden_states

                 lowerCAmelCase    :		Union[str, Any]				=      len(self.model_tester.depth )
                 self.assertEqual(len(UpperCamelCase_ )    , UpperCamelCase_ )

                 # verify the first hidden states (first block)
                 self.assertListEqual(
                     list(hidden_states[0].shape[-3:] )    , [
                         self.model_tester.embed_dim[0],
                         self.model_tester.image_size // 4,
                         self.model_tester.image_size // 4,
                     ]    , )

           lowerCAmelCase,					lowerCAmelCase    :		List[str]				=      self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                 lowerCAmelCase    :		Tuple				=      True
                 check_hidden_states_output(UpperCamelCase_    , UpperCamelCase_    , UpperCamelCase_ )

                 # check that output_hidden_states also work using config
                 del inputs_dict["output_hidden_states"]
                 lowerCAmelCase    :		Any				=      True

                 check_hidden_states_output(UpperCamelCase_    , UpperCamelCase_    , UpperCamelCase_ )






     def    lowerCamelCase__   (		self     :    Union[str, Any] ):
           lowerCAmelCase    :		int				=      self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_model(*UpperCamelCase_ )






     def    lowerCamelCase__   (		self     :    Any ):
           lowerCAmelCase    :		str				=      self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_image_classification(*UpperCamelCase_ )






     @slow
     def    lowerCamelCase__   (		self     :    List[str] ):
           for model_name in TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 lowerCAmelCase    :		Tuple				=      TFCvtModel.from_pretrained(UpperCamelCase_ )
                 self.assertIsNotNone(UpperCamelCase_ )



def    _snake_case  (  ):
      lowerCAmelCase    :		str				=      Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''	)
      return image






@require_tf
@require_vision
class 						snake_case_(				unittest.TestCase	):






     @cached_property
     def    lowerCamelCase__   (		self     :    Any ):
           return AutoImageProcessor.from_pretrained(TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST[0] )






     @slow
     def    lowerCamelCase__   (		self     :    Optional[Any] ):
           lowerCAmelCase    :		Optional[int]				=      TFCvtForImageClassification.from_pretrained(TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST[0] )

           lowerCAmelCase    :		Dict				=      self.default_image_processor
           lowerCAmelCase    :		Union[str, Any]				=      prepare_img()
           lowerCAmelCase    :		Optional[int]				=      image_processor(images=UpperCamelCase_    , return_tensors='''tf''' )

           # forward pass
           lowerCAmelCase    :		Any				=      model(**UpperCamelCase_ )

           # verify the logits
           lowerCAmelCase    :		Optional[int]				=      tf.TensorShape((1, 1_0_0_0) )
           self.assertEqual(outputs.logits.shape    , UpperCamelCase_ )

           lowerCAmelCase    :		Any				=      tf.constant([0.9_285, 0.9_015, -0.3_150] )
           self.assertTrue(np.allclose(outputs.logits[0, :3].numpy()    , UpperCamelCase_    , atol=1E-4 ) )






"""simple docstring"""





import unittest
from typing import Dict, List, Optional, Union

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
 import torch

if is_vision_available():
 from PIL import Image

 from transformers import BridgeTowerImageProcessor



class 						snake_case_(				unittest.TestCase	):






     def __init__(		self     :    Union[str, Any]    , UpperCamelCase_     :    Optional[Any]    , UpperCamelCase_     :    bool = True    , UpperCamelCase_     :    Dict[str, int] = None    , UpperCamelCase_     :    int = 3_2    , UpperCamelCase_     :    bool = True    , UpperCamelCase_     :    Union[int, float] = 1 / 2_5_5    , UpperCamelCase_     :    bool = True    , UpperCamelCase_     :    bool = True    , UpperCamelCase_     :    Optional[Union[float, List[float]]] = [0.48_145_466, 0.4_578_275, 0.40_821_073]    , UpperCamelCase_     :    Optional[Union[float, List[float]]] = [0.26_862_954, 0.26_130_258, 0.27_577_711]    , UpperCamelCase_     :    bool = True    , UpperCamelCase_     :    Optional[int]=7    , UpperCamelCase_     :    int=3_0    , UpperCamelCase_     :    str=4_0_0    , UpperCamelCase_     :    List[Any]=3    , ):
           lowerCAmelCase    :		Union[str, Any]				=      parent
           lowerCAmelCase    :		Union[str, Any]				=      do_resize
           lowerCAmelCase    :		List[str]				=      size if size is not None else {'''shortest_edge''': 2_8_8}
           lowerCAmelCase    :		int				=      size_divisor
           lowerCAmelCase    :		List[str]				=      do_rescale
           lowerCAmelCase    :		Optional[Any]				=      rescale_factor
           lowerCAmelCase    :		Dict				=      do_normalize
           lowerCAmelCase    :		Any				=      do_center_crop
           lowerCAmelCase    :		Union[str, Any]				=      image_mean
           lowerCAmelCase    :		Optional[Any]				=      image_std
           lowerCAmelCase    :		Union[str, Any]				=      do_pad
           lowerCAmelCase    :		Union[str, Any]				=      batch_size
           lowerCAmelCase    :		Any				=      num_channels
           lowerCAmelCase    :		Union[str, Any]				=      min_resolution
           lowerCAmelCase    :		int				=      max_resolution






     def    lowerCamelCase__   (		self     :    Dict ):
           return {
               "image_mean": self.image_mean,
               "image_std": self.image_std,
               "do_normalize": self.do_normalize,
               "do_resize": self.do_resize,
               "size": self.size,
               "size_divisor": self.size_divisor,
           }






     def    lowerCamelCase__   (		self     :    Any    , UpperCamelCase_     :    int    , UpperCamelCase_     :    List[str]=False ):
           if not batched:
                 lowerCAmelCase    :		Dict				=      self.size['''shortest_edge''']
                 lowerCAmelCase    :		Dict				=      image_inputs[0]
                 if isinstance(UpperCamelCase_    , Image.Image ):
                       lowerCAmelCase,					lowerCAmelCase    :		Optional[int]				=      image.size
                 else:
                       lowerCAmelCase,					lowerCAmelCase    :		List[Any]				=      image.shape[1], image.shape[2]
                 lowerCAmelCase    :		Union[str, Any]				=      size / min(UpperCamelCase_    , UpperCamelCase_ )
                 if h < w:
                       lowerCAmelCase,					lowerCAmelCase    :		Dict				=      size, scale * w
                 else:
                       lowerCAmelCase,					lowerCAmelCase    :		Optional[int]				=      scale * h, size

                 lowerCAmelCase    :		List[Any]				=      int((1_3_3_3 / 8_0_0) * size )
                 if max(UpperCamelCase_    , UpperCamelCase_ ) > max_size:
                       lowerCAmelCase    :		int				=      max_size / max(UpperCamelCase_    , UpperCamelCase_ )
                       lowerCAmelCase    :		str				=      newh * scale
                       lowerCAmelCase    :		Tuple				=      neww * scale

                 lowerCAmelCase,					lowerCAmelCase    :		List[str]				=      int(newh + 0.5 ), int(neww + 0.5 )
                 lowerCAmelCase,					lowerCAmelCase    :		Tuple				=      (
                     newh // self.size_divisor * self.size_divisor,
                     neww // self.size_divisor * self.size_divisor,
                 )

           else:
                 lowerCAmelCase    :		Optional[int]				=      []
                 for image in image_inputs:
                       lowerCAmelCase,					lowerCAmelCase    :		List[str]				=      self.get_expected_values([image] )
                       expected_values.append((expected_height, expected_width) )
                 lowerCAmelCase    :		Union[str, Any]				=      max(UpperCamelCase_    , key=lambda UpperCamelCase_ : item[0] )[0]
                 lowerCAmelCase    :		Union[str, Any]				=      max(UpperCamelCase_    , key=lambda UpperCamelCase_ : item[1] )[1]

           return expected_height, expected_width



@require_torch
@require_vision
class 						snake_case_(				a__							,    unittest.TestCase	):
     __UpperCamelCase     =    BridgeTowerImageProcessor if is_vision_available() else None






     def    lowerCamelCase__   (		self     :    Optional[int] ):
           lowerCAmelCase    :		Optional[int]				=      BridgeTowerImageProcessingTester(self )






     @property
     def    lowerCamelCase__   (		self     :    List[str] ):
           return self.image_processor_tester.prepare_image_processor_dict()






     def    lowerCamelCase__   (		self     :    List[str] ):
           lowerCAmelCase    :		Optional[Any]				=      self.image_processing_class(**self.image_processor_dict )
           self.assertTrue(hasattr(UpperCamelCase_    , '''image_mean''' ) )
           self.assertTrue(hasattr(UpperCamelCase_    , '''image_std''' ) )
           self.assertTrue(hasattr(UpperCamelCase_    , '''do_normalize''' ) )
           self.assertTrue(hasattr(UpperCamelCase_    , '''do_resize''' ) )
           self.assertTrue(hasattr(UpperCamelCase_    , '''size''' ) )
           self.assertTrue(hasattr(UpperCamelCase_    , '''size_divisor''' ) )






     def    lowerCamelCase__   (		self     :    int ):
           pass






     def    lowerCamelCase__   (		self     :    Optional[Any] ):
           # Initialize image processor
           lowerCAmelCase    :		str				=      self.image_processing_class(**self.image_processor_dict )
           # create random PIL images
           lowerCAmelCase    :		Optional[int]				=      prepare_image_inputs(self.image_processor_tester    , equal_resolution=UpperCamelCase_ )
           for image in image_inputs:
                 self.assertIsInstance(UpperCamelCase_    , Image.Image )

           # Test not batched input
           lowerCAmelCase    :		Optional[int]				=      image_processing(image_inputs[0]    , return_tensors='''pt''' ).pixel_values

           lowerCAmelCase,					lowerCAmelCase    :		List[Any]				=      self.image_processor_tester.get_expected_values(UpperCamelCase_ )
           self.assertEqual(
               encoded_images.shape    , (1, self.image_processor_tester.num_channels, expected_height, expected_width)    , )

           # Test batched
           lowerCAmelCase    :		Dict				=      image_processing(UpperCamelCase_    , return_tensors='''pt''' ).pixel_values

           lowerCAmelCase,					lowerCAmelCase    :		int				=      self.image_processor_tester.get_expected_values(UpperCamelCase_    , batched=UpperCamelCase_ )
           self.assertEqual(
               encoded_images.shape    , (
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   expected_height,
                   expected_width,
               )    , )






     def    lowerCamelCase__   (		self     :    Optional[Any] ):
           # Initialize image processor
           lowerCAmelCase    :		Tuple				=      self.image_processing_class(**self.image_processor_dict )
           # create random numpy tensors
           lowerCAmelCase    :		List[Any]				=      prepare_image_inputs(self.image_processor_tester    , equal_resolution=UpperCamelCase_    , numpify=UpperCamelCase_ )
           for image in image_inputs:
                 self.assertIsInstance(UpperCamelCase_    , np.ndarray )

           # Test not batched input
           lowerCAmelCase    :		Any				=      image_processing(image_inputs[0]    , return_tensors='''pt''' ).pixel_values

           lowerCAmelCase,					lowerCAmelCase    :		Optional[Any]				=      self.image_processor_tester.get_expected_values(UpperCamelCase_ )
           self.assertEqual(
               encoded_images.shape    , (1, self.image_processor_tester.num_channels, expected_height, expected_width)    , )

           # Test batched
           lowerCAmelCase    :		Tuple				=      image_processing(UpperCamelCase_    , return_tensors='''pt''' ).pixel_values

           lowerCAmelCase,					lowerCAmelCase    :		str				=      self.image_processor_tester.get_expected_values(UpperCamelCase_    , batched=UpperCamelCase_ )
           self.assertEqual(
               encoded_images.shape    , (
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   expected_height,
                   expected_width,
               )    , )






     def    lowerCamelCase__   (		self     :    Optional[int] ):
           # Initialize image processor
           lowerCAmelCase    :		Union[str, Any]				=      self.image_processing_class(**self.image_processor_dict )
           # create random PyTorch tensors
           lowerCAmelCase    :		List[str]				=      prepare_image_inputs(self.image_processor_tester    , equal_resolution=UpperCamelCase_    , torchify=UpperCamelCase_ )
           for image in image_inputs:
                 self.assertIsInstance(UpperCamelCase_    , torch.Tensor )

           # Test not batched input
           lowerCAmelCase    :		Any				=      image_processing(image_inputs[0]    , return_tensors='''pt''' ).pixel_values

           lowerCAmelCase,					lowerCAmelCase    :		Tuple				=      self.image_processor_tester.get_expected_values(UpperCamelCase_ )
           self.assertEqual(
               encoded_images.shape    , (1, self.image_processor_tester.num_channels, expected_height, expected_width)    , )

           # Test batched
           lowerCAmelCase    :		str				=      image_processing(UpperCamelCase_    , return_tensors='''pt''' ).pixel_values

           lowerCAmelCase,					lowerCAmelCase    :		str				=      self.image_processor_tester.get_expected_values(UpperCamelCase_    , batched=UpperCamelCase_ )
           self.assertEqual(
               encoded_images.shape    , (
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   expected_height,
                   expected_width,
               )    , )


