
"""simple docstring"""


from typing import Optional

import torch
import torch.utils.checkpoint
from torch import Tensor, nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss

from ...activations import ACTaFN
from ...file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward
from ...modeling_outputs import (
    BaseModelOutputWithNoAttention,
    BaseModelOutputWithPoolingAndNoAttention,
    ImageClassifierOutputWithNoAttention,
)
from ...modeling_utils import PreTrainedModel
from ...utils import logging
from .configuration_regnet import RegNetConfig


SCREAMING_SNAKE_CASE      =     logging.get_logger(__name__)

# General docstring
SCREAMING_SNAKE_CASE      =     """RegNetConfig"""

# Base docstring
SCREAMING_SNAKE_CASE      =     """facebook/regnet-y-040"""
SCREAMING_SNAKE_CASE      =     [1, 1_088, 7, 7]

# Image classification docstring
SCREAMING_SNAKE_CASE      =     """facebook/regnet-y-040"""
SCREAMING_SNAKE_CASE      =     """tabby, tabby cat"""

SCREAMING_SNAKE_CASE      =     [
    """facebook/regnet-y-040""",
    # See all regnet models at https://huggingface.co/models?filter=regnet
]



class   __a  (      nn.Module	):






       def __init__(  self :							Union[str, Any]       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int = 3       ,      UpperCAmelCase_ :							int = 1       ,      UpperCAmelCase_ :							int = 1       ,      UpperCAmelCase_ :							Optional[str] = "relu"       ,      )->  Any:







              """simple docstring"""
              super().__init__()
              UpperCamelCase					 =		nn.Convad(
                  UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=UpperCAmelCase_       ,      stride=UpperCAmelCase_       ,      padding=kernel_size // 2       ,      groups=UpperCAmelCase_       ,      bias=UpperCAmelCase_       ,      )
              UpperCamelCase					 =		nn.BatchNormad(UpperCAmelCase_			)
              UpperCamelCase					 =		ACTaFN[activation] if activation is not None else nn.Identity()






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[str]       ,      UpperCAmelCase_ :							List[str]			)->  Optional[int]:







              """simple docstring"""
              UpperCamelCase					 =		self.convolution(UpperCAmelCase_			)
              UpperCamelCase					 =		self.normalization(UpperCAmelCase_			)
              UpperCamelCase					 =		self.activation(UpperCAmelCase_			)
              return hidden_state





class   __a  (      nn.Module	):






       def __init__(  self :							str       ,      UpperCAmelCase_ :							RegNetConfig			)->  str:







              """simple docstring"""
              super().__init__()
              UpperCamelCase					 =		RegNetConvLayer(
                  config.num_channels       ,      config.embedding_size       ,      kernel_size=3       ,      stride=2       ,      activation=config.hidden_act			)
              UpperCamelCase					 =		config.num_channels






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[Any]       ,      UpperCAmelCase_ :							List[Any]			)->  str:







              """simple docstring"""
              UpperCamelCase					 =		pixel_values.shape[1]
              if num_channels != self.num_channels:
                     raise ValueError(
                         "Make sure that the channel dimension of the pixel values match with the one set in the configuration."			)
              UpperCamelCase					 =		self.embedder(UpperCAmelCase_			)
              return hidden_state





class   __a  (      nn.Module	):






       def __init__(  self :							Any       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int = 2			)->  Union[str, Any]:







              """simple docstring"""
              super().__init__()
              UpperCamelCase					 =		nn.Convad(UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=1       ,      stride=UpperCAmelCase_       ,      bias=UpperCAmelCase_			)
              UpperCamelCase					 =		nn.BatchNormad(UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]       ,      UpperCAmelCase_ :							Tensor			)->  Tensor:







              """simple docstring"""
              UpperCamelCase					 =		self.convolution(UpperCAmelCase_			)
              UpperCamelCase					 =		self.normalization(UpperCAmelCase_			)
              return hidden_state





class   __a  (      nn.Module	):






       def __init__(  self :							str       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int			)->  Union[str, Any]:







              """simple docstring"""
              super().__init__()

              UpperCamelCase					 =		nn.AdaptiveAvgPoolad((1, 1)			)
              UpperCamelCase					 =		nn.Sequential(
                  nn.Convad(UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=1			)       ,      nn.ReLU()       ,      nn.Convad(UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=1			)       ,      nn.Sigmoid()       ,      )






       def 	_SCREAMING_SNAKE_CASE       (  self :							Union[str, Any]       ,      UpperCAmelCase_ :							Dict			)->  int:







              """simple docstring"""
              # b c h w -> b c 1 1
              UpperCamelCase					 =		self.pooler(UpperCAmelCase_			)
              UpperCamelCase					 =		self.attention(UpperCAmelCase_			)
              UpperCamelCase					 =		hidden_state * attention
              return hidden_state





class   __a  (      nn.Module	):






       def __init__(  self :							Optional[Any]       ,      UpperCAmelCase_ :							RegNetConfig       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int = 1			)->  int:







              """simple docstring"""
              super().__init__()
              UpperCamelCase					 =		in_channels != out_channels or stride != 1
              UpperCamelCase					 =		max(1       ,      out_channels // config.groups_width			)
              UpperCamelCase					 =		(
                  RegNetShortCut(UpperCAmelCase_       ,      UpperCAmelCase_       ,      stride=UpperCAmelCase_			) if should_apply_shortcut else nn.Identity()
              )
              UpperCamelCase					 =		nn.Sequential(
                  RegNetConvLayer(UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=1       ,      activation=config.hidden_act			)       ,      RegNetConvLayer(UpperCAmelCase_       ,      UpperCAmelCase_       ,      stride=UpperCAmelCase_       ,      groups=UpperCAmelCase_       ,      activation=config.hidden_act			)       ,      RegNetConvLayer(UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=1       ,      activation=UpperCAmelCase_			)       ,      )
              UpperCamelCase					 =		ACTaFN[config.hidden_act]






       def 	_SCREAMING_SNAKE_CASE       (  self :							Union[str, Any]       ,      UpperCAmelCase_ :							int			)->  Dict:







              """simple docstring"""
              UpperCamelCase					 =		hidden_state
              UpperCamelCase					 =		self.layer(UpperCAmelCase_			)
              UpperCamelCase					 =		self.shortcut(UpperCAmelCase_			)
              hidden_state += residual
              UpperCamelCase					 =		self.activation(UpperCAmelCase_			)
              return hidden_state





class   __a  (      nn.Module	):






       def __init__(  self :							int       ,      UpperCAmelCase_ :							RegNetConfig       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int = 1			)->  int:







              """simple docstring"""
              super().__init__()
              UpperCamelCase					 =		in_channels != out_channels or stride != 1
              UpperCamelCase					 =		max(1       ,      out_channels // config.groups_width			)
              UpperCamelCase					 =		(
                  RegNetShortCut(UpperCAmelCase_       ,      UpperCAmelCase_       ,      stride=UpperCAmelCase_			) if should_apply_shortcut else nn.Identity()
              )
              UpperCamelCase					 =		nn.Sequential(
                  RegNetConvLayer(UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=1       ,      activation=config.hidden_act			)       ,      RegNetConvLayer(UpperCAmelCase_       ,      UpperCAmelCase_       ,      stride=UpperCAmelCase_       ,      groups=UpperCAmelCase_       ,      activation=config.hidden_act			)       ,      RegNetSELayer(UpperCAmelCase_       ,      reduced_channels=int(round(in_channels / 4			)			)			)       ,      RegNetConvLayer(UpperCAmelCase_       ,      UpperCAmelCase_       ,      kernel_size=1       ,      activation=UpperCAmelCase_			)       ,      )
              UpperCamelCase					 =		ACTaFN[config.hidden_act]






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[Any]       ,      UpperCAmelCase_ :							Union[str, Any]			)->  Optional[Any]:







              """simple docstring"""
              UpperCamelCase					 =		hidden_state
              UpperCamelCase					 =		self.layer(UpperCAmelCase_			)
              UpperCamelCase					 =		self.shortcut(UpperCAmelCase_			)
              hidden_state += residual
              UpperCamelCase					 =		self.activation(UpperCAmelCase_			)
              return hidden_state





class   __a  (      nn.Module	):






       def __init__(  self :							Dict       ,      UpperCAmelCase_ :							RegNetConfig       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							int = 2       ,      UpperCAmelCase_ :							int = 2       ,      )->  Tuple:







              """simple docstring"""
              super().__init__()

              UpperCamelCase					 =		RegNetXLayer if config.layer_type == "x" else RegNetYLayer

              UpperCamelCase					 =		nn.Sequential(
                  # downsampling is done in the first layer with stride of 2
                  layer(
                      UpperCAmelCase_       ,      UpperCAmelCase_       ,      UpperCAmelCase_       ,      stride=UpperCAmelCase_       ,      )       ,      *[layer(UpperCAmelCase_       ,      UpperCAmelCase_       ,      UpperCAmelCase_			) for _ in range(depth - 1			)]       ,      )






       def 	_SCREAMING_SNAKE_CASE       (  self :							int       ,      UpperCAmelCase_ :							List[str]			)->  Optional[Any]:







              """simple docstring"""
              UpperCamelCase					 =		self.layers(UpperCAmelCase_			)
              return hidden_state





class   __a  (      nn.Module	):






       def __init__(  self :							Dict       ,      UpperCAmelCase_ :							RegNetConfig			)->  Tuple:







              """simple docstring"""
              super().__init__()
              UpperCamelCase					 =		nn.ModuleList([]			)
              # based on `downsample_in_first_stage`, the first layer of the first stage may or may not downsample the input
              self.stages.append(
                  RegNetStage(
                      UpperCAmelCase_       ,      config.embedding_size       ,      config.hidden_sizes[0]       ,      stride=2 if config.downsample_in_first_stage else 1       ,      depth=config.depths[0]       ,      )			)
              UpperCamelCase					 =		zip(config.hidden_sizes       ,      config.hidden_sizes[1:]			)
              for (in_channels, out_channels), depth in zip(UpperCAmelCase_       ,      config.depths[1:]			):
                     self.stages.append(RegNetStage(UpperCAmelCase_       ,      UpperCAmelCase_       ,      UpperCAmelCase_       ,      depth=UpperCAmelCase_			)			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[Any]       ,      UpperCAmelCase_ :							Tensor       ,      UpperCAmelCase_ :							bool = False       ,      UpperCAmelCase_ :							bool = True			)->  BaseModelOutputWithNoAttention:







              """simple docstring"""
              UpperCamelCase					 =		() if output_hidden_states else None

              for stage_module in self.stages:
                     if output_hidden_states:
                            UpperCamelCase					 =		hidden_states + (hidden_state,)

                     UpperCamelCase					 =		stage_module(UpperCAmelCase_			)

              if output_hidden_states:
                     UpperCamelCase					 =		hidden_states + (hidden_state,)

              if not return_dict:
                     return tuple(v for v in [hidden_state, hidden_states] if v is not None			)

              return BaseModelOutputWithNoAttention(last_hidden_state=UpperCAmelCase_       ,      hidden_states=UpperCAmelCase_			)





class   __a  (      _lowerCAmelCase	):
       UpperCamelCase_		:					int   =			RegNetConfig
       UpperCamelCase_		:					List[str]   =			'''regnet'''
       UpperCamelCase_		:					Tuple   =			'''pixel_values'''
       UpperCamelCase_		:					Optional[int]   =			True






       def 	_SCREAMING_SNAKE_CASE       (  self :							int       ,      UpperCAmelCase_ :							int			)->  Optional[Any]:







              """simple docstring"""
              if isinstance(UpperCAmelCase_       ,      nn.Convad			):
                     nn.init.kaiming_normal_(module.weight       ,      mode="fan_out"       ,      nonlinearity="relu"			)
              elif isinstance(UpperCAmelCase_       ,      (nn.BatchNormad, nn.GroupNorm)			):
                     nn.init.constant_(module.weight       ,      1			)
                     nn.init.constant_(module.bias       ,      0			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Dict       ,      UpperCAmelCase_ :							int       ,      UpperCAmelCase_ :							Any=False			)->  Any:







              """simple docstring"""
              if isinstance(UpperCAmelCase_       ,      UpperCAmelCase_			):
                     UpperCamelCase					 =		value





SCREAMING_SNAKE_CASE      =     R"""
    This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it
    as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
    behavior.

    Parameters:
        config ([`RegNetConfig`]): Model configuration class with all the parameters of the model.
            Initializing with a config file does not load the weights associated with the model, only the
            configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
"""

SCREAMING_SNAKE_CASE      =     R"""
    Args:
        pixel_values (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`):
            Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See
            [`ConvNextImageProcessor.__call__`] for details.

        output_hidden_states (`bool`, *optional*):
            Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
            more detail.
        return_dict (`bool`, *optional*):
            Whether or not to return a [`~file_utils.ModelOutput`] instead of a plain tuple.
"""



@add_start_docstrings(
    '''The bare RegNet model outputting raw features without any specific head on top.'''    ,     _lowerCAmelCase    ,     )
# Copied from transformers.models.resnet.modeling_resnet.ResNetModel with RESNET->REGNET,ResNet->RegNet
class   __a  (      _lowerCAmelCase	):






       def __init__(  self :							str       ,      UpperCAmelCase_ :							Any			)->  Dict:







              """simple docstring"""
              super().__init__(UpperCAmelCase_			)
              UpperCamelCase					 =		config
              UpperCamelCase					 =		RegNetEmbeddings(UpperCAmelCase_			)
              UpperCamelCase					 =		RegNetEncoder(UpperCAmelCase_			)
              UpperCamelCase					 =		nn.AdaptiveAvgPoolad((1, 1)			)
              # Initialize weights and apply final processing
              self.post_init()






       @add_start_docstrings_to_model_forward(UpperCAmelCase_			)
       @add_code_sample_docstrings(
           checkpoint=_CHECKPOINT_FOR_DOC       ,      output_type=UpperCAmelCase_       ,      config_class=_CONFIG_FOR_DOC       ,      modality="vision"       ,      expected_output=_EXPECTED_OUTPUT_SHAPE       ,      )
       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]       ,      UpperCAmelCase_ :							Tensor       ,      UpperCAmelCase_ :							Optional[bool] = None       ,      UpperCAmelCase_ :							Optional[bool] = None			)->  BaseModelOutputWithPoolingAndNoAttention:







              """simple docstring"""
              UpperCamelCase					 =		(
                  output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
              )
              UpperCamelCase					 =		return_dict if return_dict is not None else self.config.use_return_dict

              UpperCamelCase					 =		self.embedder(UpperCAmelCase_			)

              UpperCamelCase					 =		self.encoder(
                  UpperCAmelCase_       ,      output_hidden_states=UpperCAmelCase_       ,      return_dict=UpperCAmelCase_			)

              UpperCamelCase					 =		encoder_outputs[0]

              UpperCamelCase					 =		self.pooler(UpperCAmelCase_			)

              if not return_dict:
                     return (last_hidden_state, pooled_output) + encoder_outputs[1:]

              return BaseModelOutputWithPoolingAndNoAttention(
                  last_hidden_state=UpperCAmelCase_       ,      pooler_output=UpperCAmelCase_       ,      hidden_states=encoder_outputs.hidden_states       ,      )





@add_start_docstrings(
    '''
    RegNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
    ImageNet.
    '''    ,     _lowerCAmelCase    ,     )
# Copied from transformers.models.resnet.modeling_resnet.ResNetForImageClassification with RESNET->REGNET,ResNet->RegNet,resnet->regnet
class   __a  (      _lowerCAmelCase	):






       def __init__(  self :							Tuple       ,      UpperCAmelCase_ :							Tuple			)->  Optional[Any]:







              """simple docstring"""
              super().__init__(UpperCAmelCase_			)
              UpperCamelCase					 =		config.num_labels
              UpperCamelCase					 =		RegNetModel(UpperCAmelCase_			)
              # classification head
              UpperCamelCase					 =		nn.Sequential(
                  nn.Flatten()       ,      nn.Linear(config.hidden_sizes[-1]       ,      config.num_labels			) if config.num_labels > 0 else nn.Identity()       ,      )
              # initialize weights and apply final processing
              self.post_init()






       @add_start_docstrings_to_model_forward(UpperCAmelCase_			)
       @add_code_sample_docstrings(
           checkpoint=_IMAGE_CLASS_CHECKPOINT       ,      output_type=UpperCAmelCase_       ,      config_class=_CONFIG_FOR_DOC       ,      expected_output=_IMAGE_CLASS_EXPECTED_OUTPUT       ,      )
       def 	_SCREAMING_SNAKE_CASE       (  self :							Union[str, Any]       ,      UpperCAmelCase_ :							Optional[torch.FloatTensor] = None       ,      UpperCAmelCase_ :							Optional[torch.LongTensor] = None       ,      UpperCAmelCase_ :							Optional[bool] = None       ,      UpperCAmelCase_ :							Optional[bool] = None       ,      )->  ImageClassifierOutputWithNoAttention:







              """simple docstring"""
              UpperCamelCase					 =		return_dict if return_dict is not None else self.config.use_return_dict

              UpperCamelCase					 =		self.regnet(UpperCAmelCase_       ,      output_hidden_states=UpperCAmelCase_       ,      return_dict=UpperCAmelCase_			)

              UpperCamelCase					 =		outputs.pooler_output if return_dict else outputs[1]

              UpperCamelCase					 =		self.classifier(UpperCAmelCase_			)

              UpperCamelCase					 =		None

              if labels is not None:
                     if self.config.problem_type is None:
                            if self.num_labels == 1:
                                   UpperCamelCase					 =		"regression"
                            elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
                                   UpperCamelCase					 =		"single_label_classification"
                            else:
                                   UpperCamelCase					 =		"multi_label_classification"
                     if self.config.problem_type == "regression":
                            UpperCamelCase					 =		MSELoss()
                            if self.num_labels == 1:
                                   UpperCamelCase					 =		loss_fct(logits.squeeze()       ,      labels.squeeze()			)
                            else:
                                   UpperCamelCase					 =		loss_fct(UpperCAmelCase_       ,      UpperCAmelCase_			)
                     elif self.config.problem_type == "single_label_classification":
                            UpperCamelCase					 =		CrossEntropyLoss()
                            UpperCamelCase					 =		loss_fct(logits.view(-1       ,      self.num_labels			)       ,      labels.view(-1			)			)
                     elif self.config.problem_type == "multi_label_classification":
                            UpperCamelCase					 =		BCEWithLogitsLoss()
                            UpperCamelCase					 =		loss_fct(UpperCAmelCase_       ,      UpperCAmelCase_			)

              if not return_dict:
                     UpperCamelCase					 =		(logits,) + outputs[2:]
                     return (loss,) + output if loss is not None else output

              return ImageClassifierOutputWithNoAttention(loss=UpperCAmelCase_       ,      logits=UpperCAmelCase_       ,      hidden_states=outputs.hidden_states			)







"""simple docstring"""


import os
import unittest

from transformers import FunnelTokenizer, FunnelTokenizerFast
from transformers.models.funnel.tokenization_funnel import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin



@require_tokenizers
class   __a  (      _lowerCAmelCase    ,     unittest.TestCase	):
       UpperCamelCase_		:					str   =			FunnelTokenizer
       UpperCamelCase_		:					Any   =			FunnelTokenizerFast
       UpperCamelCase_		:					Union[str, Any]   =			True
       UpperCamelCase_		:					Tuple   =			True






       def 	_SCREAMING_SNAKE_CASE       (  self :							Tuple			)->  Optional[int]:







              """simple docstring"""
              super().setUp()

              UpperCamelCase					 =		[
                  "<unk>",
                  "<cls>",
                  "<sep>",
                  "want",
                  "##want",
                  "##ed",
                  "wa",
                  "un",
                  "runn",
                  "##ing",
                  ",",
                  "low",
                  "lowest",
              ]
              UpperCamelCase					 =		os.path.join(self.tmpdirname       ,      VOCAB_FILES_NAMES["vocab_file"]			)
              with open(self.vocab_file       ,      "w"       ,      encoding="utf-8"			) as vocab_writer:
                     vocab_writer.write("".join([x + "\n" for x in vocab_tokens]			)			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]       ,      **UpperCAmelCase_ :							Optional[Any]			)->  str:







              """simple docstring"""
              return FunnelTokenizer.from_pretrained(self.tmpdirname       ,      **UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Dict       ,      **UpperCAmelCase_ :							Any			)->  Union[str, Any]:







              """simple docstring"""
              return FunnelTokenizerFast.from_pretrained(self.tmpdirname       ,      **UpperCAmelCase_			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							Dict       ,      UpperCAmelCase_ :							Tuple			)->  str:







              """simple docstring"""
              UpperCamelCase					 =		"UNwant\u00E9d,running"
              UpperCamelCase					 =		"unwanted, running"
              return input_text, output_text






       def 	_SCREAMING_SNAKE_CASE       (  self :							str			)->  List[str]:







              """simple docstring"""
              UpperCamelCase					 =		self.tokenizer_class(self.vocab_file			)

              UpperCamelCase					 =		tokenizer.tokenize("UNwant\u00E9d,running"			)
              self.assertListEqual(UpperCAmelCase_       ,      ["un", "##want", "##ed", ",", "runn", "##ing"]			)
              self.assertListEqual(tokenizer.convert_tokens_to_ids(UpperCAmelCase_			)       ,      [7, 4, 5, 10, 8, 9]			)






       def 	_SCREAMING_SNAKE_CASE       (  self :							List[Any]			)->  Optional[int]:







              """simple docstring"""
              UpperCamelCase					 =		self.get_tokenizers(do_lower_case=UpperCAmelCase_			)
              for tokenizer in tokenizers:
                     UpperCamelCase					 =		tokenizer("UNwant\u00E9d,running"			)
                     UpperCamelCase					 =		len(inputs["input_ids"]			) - 1
                     self.assertListEqual(inputs["token_type_ids"]       ,      [2] + [0] * sentence_len			)

                     UpperCamelCase					 =		tokenizer("UNwant\u00E9d,running"       ,      "UNwant\u00E9d,running"			)
                     self.assertListEqual(inputs["token_type_ids"]       ,      [2] + [0] * sentence_len + [1] * sentence_len			)





