



from dataclasses import dataclass
from typing import Optional

import numpy as np
import torch
import torch.nn as nn

from ..utils import BaseOutput, is_torch_version, randn_tensor
from .attention_processor import SpatialNorm
from .unet_ad_blocks import UNetMidBlockaD, get_down_block, get_up_block




@dataclass
class 					_SCREAMING_SNAKE_CASE  (      __lowerCamelCase ):
      _A						:		Any    	=     42





class 					_SCREAMING_SNAKE_CASE  (      nn.Module ):
      def __init__(			self		,	lowerCamelCase=3		,	lowerCamelCase=3		,	lowerCamelCase=("DownEncoderBlock2D",)		,	lowerCamelCase=(64,)		,	lowerCamelCase=2		,	lowerCamelCase=32		,	lowerCamelCase="silu"		,	lowerCamelCase=True		,	):
          super().__init__()
          snake_case__						=				layers_per_block

          snake_case__						=				torch.nn.Convad(
              SCREAMING_SNAKE_CASE_		,	block_out_channels[0]		,	kernel_size=3		,	stride=1		,	padding=1		,	)

          snake_case__						=				None
          snake_case__						=				nn.ModuleList([] )

          # down
          snake_case__						=				block_out_channels[0]
          for i, down_block_type in enumerate(SCREAMING_SNAKE_CASE_ ):
              snake_case__						=				output_channel
              snake_case__						=				block_out_channels[i]
              snake_case__						=				i == len(SCREAMING_SNAKE_CASE_ ) - 1

              snake_case__						=				get_down_block(
                  SCREAMING_SNAKE_CASE_		,	num_layers=self.layers_per_block		,	in_channels=SCREAMING_SNAKE_CASE_		,	out_channels=SCREAMING_SNAKE_CASE_		,	add_downsample=not is_final_block		,	resnet_eps=1e-6		,	downsample_padding=0		,	resnet_act_fn=SCREAMING_SNAKE_CASE_		,	resnet_groups=SCREAMING_SNAKE_CASE_		,	attention_head_dim=SCREAMING_SNAKE_CASE_		,	temb_channels=SCREAMING_SNAKE_CASE_		,	)
              self.down_blocks.append(SCREAMING_SNAKE_CASE_ )

          # mid
          snake_case__						=				UNetMidBlockaD(
              in_channels=block_out_channels[-1]		,	resnet_eps=1e-6		,	resnet_act_fn=SCREAMING_SNAKE_CASE_		,	output_scale_factor=1		,	resnet_time_scale_shift="default"		,	attention_head_dim=block_out_channels[-1]		,	resnet_groups=SCREAMING_SNAKE_CASE_		,	temb_channels=SCREAMING_SNAKE_CASE_		,	)

          # out
          snake_case__						=				nn.GroupNorm(num_channels=block_out_channels[-1]		,	num_groups=SCREAMING_SNAKE_CASE_		,	eps=1e-6 )
          snake_case__						=				nn.SiLU()

          snake_case__						=				2 * out_channels if double_z else out_channels
          snake_case__						=				nn.Convad(block_out_channels[-1]		,	SCREAMING_SNAKE_CASE_		,	3		,	padding=1 )

          snake_case__						=				False



      def A_			(			self		,	lowerCamelCase ):
          snake_case__						=				x
          snake_case__						=				self.conv_in(SCREAMING_SNAKE_CASE_ )

          if self.training and self.gradient_checkpointing:

              def create_custom_forward(lowerCamelCase ):
                  def custom_forward(*lowerCamelCase ):
                      return module(*SCREAMING_SNAKE_CASE_ )

                  return custom_forward

              # down
              if is_torch_version(">="		,	"1.11.0" ):
                  for down_block in self.down_blocks:
                      snake_case__						=				torch.utils.checkpoint.checkpoint(
                          create_custom_forward(SCREAMING_SNAKE_CASE_ )		,	SCREAMING_SNAKE_CASE_		,	use_reentrant=SCREAMING_SNAKE_CASE_ )
                  # middle
                  snake_case__						=				torch.utils.checkpoint.checkpoint(
                      create_custom_forward(self.mid_block )		,	SCREAMING_SNAKE_CASE_		,	use_reentrant=SCREAMING_SNAKE_CASE_ )
              else:
                  for down_block in self.down_blocks:
                      snake_case__						=				torch.utils.checkpoint.checkpoint(create_custom_forward(SCREAMING_SNAKE_CASE_ )		,	SCREAMING_SNAKE_CASE_ )
                  # middle
                  snake_case__						=				torch.utils.checkpoint.checkpoint(create_custom_forward(self.mid_block )		,	SCREAMING_SNAKE_CASE_ )

          else:
              # down
              for down_block in self.down_blocks:
                  snake_case__						=				down_block(SCREAMING_SNAKE_CASE_ )

              # middle
              snake_case__						=				self.mid_block(SCREAMING_SNAKE_CASE_ )

          # post-process
          snake_case__						=				self.conv_norm_out(SCREAMING_SNAKE_CASE_ )
          snake_case__						=				self.conv_act(SCREAMING_SNAKE_CASE_ )
          snake_case__						=				self.conv_out(SCREAMING_SNAKE_CASE_ )

          return sample





class 					_SCREAMING_SNAKE_CASE  (      nn.Module ):
      def __init__(			self		,	lowerCamelCase=3		,	lowerCamelCase=3		,	lowerCamelCase=("UpDecoderBlock2D",)		,	lowerCamelCase=(64,)		,	lowerCamelCase=2		,	lowerCamelCase=32		,	lowerCamelCase="silu"		,	lowerCamelCase="group"		,	):
          super().__init__()
          snake_case__						=				layers_per_block

          snake_case__						=				nn.Convad(
              SCREAMING_SNAKE_CASE_		,	block_out_channels[-1]		,	kernel_size=3		,	stride=1		,	padding=1		,	)

          snake_case__						=				None
          snake_case__						=				nn.ModuleList([] )

          snake_case__						=				in_channels if norm_type == "spatial" else None

          # mid
          snake_case__						=				UNetMidBlockaD(
              in_channels=block_out_channels[-1]		,	resnet_eps=1e-6		,	resnet_act_fn=SCREAMING_SNAKE_CASE_		,	output_scale_factor=1		,	resnet_time_scale_shift="default" if norm_type == "group" else norm_type		,	attention_head_dim=block_out_channels[-1]		,	resnet_groups=SCREAMING_SNAKE_CASE_		,	temb_channels=SCREAMING_SNAKE_CASE_		,	)

          # up
          snake_case__						=				list(reversed(SCREAMING_SNAKE_CASE_ ) )
          snake_case__						=				reversed_block_out_channels[0]
          for i, up_block_type in enumerate(SCREAMING_SNAKE_CASE_ ):
              snake_case__						=				output_channel
              snake_case__						=				reversed_block_out_channels[i]

              snake_case__						=				i == len(SCREAMING_SNAKE_CASE_ ) - 1

              snake_case__						=				get_up_block(
                  SCREAMING_SNAKE_CASE_		,	num_layers=self.layers_per_block + 1		,	in_channels=SCREAMING_SNAKE_CASE_		,	out_channels=SCREAMING_SNAKE_CASE_		,	prev_output_channel=SCREAMING_SNAKE_CASE_		,	add_upsample=not is_final_block		,	resnet_eps=1e-6		,	resnet_act_fn=SCREAMING_SNAKE_CASE_		,	resnet_groups=SCREAMING_SNAKE_CASE_		,	attention_head_dim=SCREAMING_SNAKE_CASE_		,	temb_channels=SCREAMING_SNAKE_CASE_		,	resnet_time_scale_shift=SCREAMING_SNAKE_CASE_		,	)
              self.up_blocks.append(SCREAMING_SNAKE_CASE_ )
              snake_case__						=				output_channel

          # out
          if norm_type == "spatial":
              snake_case__						=				SpatialNorm(block_out_channels[0]		,	SCREAMING_SNAKE_CASE_ )
          else:
              snake_case__						=				nn.GroupNorm(num_channels=block_out_channels[0]		,	num_groups=SCREAMING_SNAKE_CASE_		,	eps=1e-6 )
          snake_case__						=				nn.SiLU()
          snake_case__						=				nn.Convad(block_out_channels[0]		,	SCREAMING_SNAKE_CASE_		,	3		,	padding=1 )

          snake_case__						=				False



      def A_			(			self		,	lowerCamelCase		,	lowerCamelCase=None ):
          snake_case__						=				z
          snake_case__						=				self.conv_in(SCREAMING_SNAKE_CASE_ )

          snake_case__						=				next(iter(self.up_blocks.parameters() ) ).dtype
          if self.training and self.gradient_checkpointing:

              def create_custom_forward(lowerCamelCase ):
                  def custom_forward(*lowerCamelCase ):
                      return module(*SCREAMING_SNAKE_CASE_ )

                  return custom_forward

              if is_torch_version(">="		,	"1.11.0" ):
                  # middle
                  snake_case__						=				torch.utils.checkpoint.checkpoint(
                      create_custom_forward(self.mid_block )		,	SCREAMING_SNAKE_CASE_		,	SCREAMING_SNAKE_CASE_		,	use_reentrant=SCREAMING_SNAKE_CASE_ )
                  snake_case__						=				sample.to(SCREAMING_SNAKE_CASE_ )

                  # up
                  for up_block in self.up_blocks:
                      snake_case__						=				torch.utils.checkpoint.checkpoint(
                          create_custom_forward(SCREAMING_SNAKE_CASE_ )		,	SCREAMING_SNAKE_CASE_		,	SCREAMING_SNAKE_CASE_		,	use_reentrant=SCREAMING_SNAKE_CASE_ )
              else:
                  # middle
                  snake_case__						=				torch.utils.checkpoint.checkpoint(
                      create_custom_forward(self.mid_block )		,	SCREAMING_SNAKE_CASE_		,	SCREAMING_SNAKE_CASE_ )
                  snake_case__						=				sample.to(SCREAMING_SNAKE_CASE_ )

                  # up
                  for up_block in self.up_blocks:
                      snake_case__						=				torch.utils.checkpoint.checkpoint(create_custom_forward(SCREAMING_SNAKE_CASE_ )		,	SCREAMING_SNAKE_CASE_		,	SCREAMING_SNAKE_CASE_ )
          else:
              # middle
              snake_case__						=				self.mid_block(SCREAMING_SNAKE_CASE_		,	SCREAMING_SNAKE_CASE_ )
              snake_case__						=				sample.to(SCREAMING_SNAKE_CASE_ )

              # up
              for up_block in self.up_blocks:
                  snake_case__						=				up_block(SCREAMING_SNAKE_CASE_		,	SCREAMING_SNAKE_CASE_ )

        # post-process
          if latent_embeds is None:
              snake_case__						=				self.conv_norm_out(SCREAMING_SNAKE_CASE_ )
          else:
              snake_case__						=				self.conv_norm_out(SCREAMING_SNAKE_CASE_		,	SCREAMING_SNAKE_CASE_ )
          snake_case__						=				self.conv_act(SCREAMING_SNAKE_CASE_ )
          snake_case__						=				self.conv_out(SCREAMING_SNAKE_CASE_ )

          return sample





class 					_SCREAMING_SNAKE_CASE  (      nn.Module ):
      def __init__(			self		,	lowerCamelCase		,	lowerCamelCase		,	lowerCamelCase		,	lowerCamelCase=None		,	lowerCamelCase="random"		,	lowerCamelCase=False		,	lowerCamelCase=True ):
          super().__init__()
          snake_case__						=				n_e
          snake_case__						=				vq_embed_dim
          snake_case__						=				beta
          snake_case__						=				legacy

          snake_case__						=				nn.Embedding(self.n_e		,	self.vq_embed_dim )
          self.embedding.weight.data.uniform_(-1.0 / self.n_e		,	1.0 / self.n_e )

          snake_case__						=				remap
          if self.remap is not None:
              self.register_buffer("used"		,	torch.tensor(np.load(self.remap ) ) )
              snake_case__						=				self.used.shape[0]
              snake_case__						=				unknown_index  # "random" or "extra" or integer
              if self.unknown_index == "extra":
                  snake_case__						=				self.re_embed
                  snake_case__						=				self.re_embed + 1
              print(
                  F"""Remapping {self.n_e} indices to {self.re_embed} indices. """
                  F"""Using {self.unknown_index} for unknown indices.""" )
          else:
              snake_case__						=				n_e

          snake_case__						=				sane_index_shape
      def A_			(			self		,	lowerCamelCase ):
          snake_case__						=				inds.shape
          assert len(SCREAMING_SNAKE_CASE_ ) > 1
          snake_case__						=				inds.reshape(ishape[0]		,	-1 )
          snake_case__						=				self.used.to(SCREAMING_SNAKE_CASE_ )
          snake_case__						=				(inds[:, :, None] == used[None, None, ...]).long()
          snake_case__						=				match.argmax(-1 )
          snake_case__						=				match.sum(2 ) < 1
          if self.unknown_index == "random":
              snake_case__						=				torch.randint(0		,	self.re_embed		,	size=new[unknown].shape ).to(device=new.device )
          else:
              snake_case__						=				self.unknown_index
          return new.reshape(SCREAMING_SNAKE_CASE_ )
      def A_			(			self		,	lowerCamelCase ):
          snake_case__						=				inds.shape
          assert len(SCREAMING_SNAKE_CASE_ ) > 1
          snake_case__						=				inds.reshape(ishape[0]		,	-1 )
          snake_case__						=				self.used.to(SCREAMING_SNAKE_CASE_ )
          if self.re_embed > self.used.shape[0]:  # extra token
              snake_case__						=				0  # simply set to zero
          snake_case__						=				torch.gather(used[None, :][inds.shape[0] * [0], :]		,	1		,	SCREAMING_SNAKE_CASE_ )
          return back.reshape(SCREAMING_SNAKE_CASE_ )
      def A_			(			self		,	lowerCamelCase ):
          # reshape z -> (batch, height, width, channel) and flatten
          snake_case__						=				z.permute(0		,	2		,	3		,	1 ).contiguous()
          snake_case__						=				z.view(-1		,	self.vq_embed_dim )

          # distances from z to embeddings e_j (z - e)^2 = z^2 + e^2 - 2 e * z
          snake_case__						=				torch.argmin(torch.cdist(SCREAMING_SNAKE_CASE_		,	self.embedding.weight )		,	dim=1 )

          snake_case__						=				self.embedding(SCREAMING_SNAKE_CASE_ ).view(z.shape )
          snake_case__						=				None
          snake_case__						=				None

          # compute loss for embedding
          if not self.legacy:
              snake_case__						=				self.beta * torch.mean((z_q.detach() - z) ** 2 ) + torch.mean((z_q - z.detach()) ** 2 )
          else:
              snake_case__						=				torch.mean((z_q.detach() - z) ** 2 ) + self.beta * torch.mean((z_q - z.detach()) ** 2 )

          # preserve gradients
          snake_case__						=				z + (z_q - z).detach()

          # reshape back to match original input shape
          snake_case__						=				z_q.permute(0		,	3		,	1		,	2 ).contiguous()

          if self.remap is not None:
              snake_case__						=				min_encoding_indices.reshape(z.shape[0]		,	-1 )  # add batch axis
              snake_case__						=				self.remap_to_used(SCREAMING_SNAKE_CASE_ )
              snake_case__						=				min_encoding_indices.reshape(-1		,	1 )  # flatten

          if self.sane_index_shape:
              snake_case__						=				min_encoding_indices.reshape(z_q.shape[0]		,	z_q.shape[2]		,	z_q.shape[3] )

          return z_q, loss, (perplexity, min_encodings, min_encoding_indices)



      def A_			(			self		,	lowerCamelCase		,	lowerCamelCase ):
          # shape specifying (batch, height, width, channel)
          if self.remap is not None:
              snake_case__						=				indices.reshape(shape[0]		,	-1 )  # add batch axis
              snake_case__						=				self.unmap_to_all(SCREAMING_SNAKE_CASE_ )
              snake_case__						=				indices.reshape(-1 )  # flatten again

          # get quantized latent vectors
          snake_case__						=				self.embedding(SCREAMING_SNAKE_CASE_ )

          if shape is not None:
              snake_case__						=				z_q.view(SCREAMING_SNAKE_CASE_ )
              # reshape back to match original input shape
              snake_case__						=				z_q.permute(0		,	3		,	1		,	2 ).contiguous()

          return z_q





class 					_SCREAMING_SNAKE_CASE  (      __lowerCamelCase ):
      def __init__(			self		,	lowerCamelCase		,	lowerCamelCase=False ):
          snake_case__						=				parameters
          snake_case__						,					snake_case__						=				torch.chunk(SCREAMING_SNAKE_CASE_		,	2		,	dim=1 )
          snake_case__						=				torch.clamp(self.logvar		,	-3_0.0		,	2_0.0 )
          snake_case__						=				deterministic
          snake_case__						=				torch.exp(0.5 * self.logvar )
          snake_case__						=				torch.exp(self.logvar )
          if self.deterministic:
              snake_case__						=				snake_case__						=				torch.zeros_like(
                  self.mean		,	device=self.parameters.device		,	dtype=self.parameters.dtype )
      def A_			(			self		,	lowerCamelCase = None ):
          # make sure sample is on the same device as the parameters and has same dtype
          snake_case__						=				randn_tensor(
              self.mean.shape		,	generator=SCREAMING_SNAKE_CASE_		,	device=self.parameters.device		,	dtype=self.parameters.dtype )
          snake_case__						=				self.mean + self.std * sample
          return x
      def A_			(			self		,	lowerCamelCase=None ):
          if self.deterministic:
              return torch.Tensor([0.0] )
          else:
              if other is None:
                  return 0.5 * torch.sum(torch.pow(self.mean		,	2 ) + self.var - 1.0 - self.logvar		,	dim=[1, 2, 3] )
              else:
                  return 0.5 * torch.sum(
                      torch.pow(self.mean - other.mean		,	2 ) / other.var
                      + self.var / other.var
                      - 1.0
                      - self.logvar
                      + other.logvar		,	dim=[1, 2, 3]		,	)
      def A_			(			self		,	lowerCamelCase		,	lowerCamelCase=[1, 2, 3] ):
          if self.deterministic:
              return torch.Tensor([0.0] )
          snake_case__						=				np.log(2.0 * np.pi )
          return 0.5 * torch.sum(logtwopi + self.logvar + torch.pow(sample - self.mean		,	2 ) / self.var		,	dim=SCREAMING_SNAKE_CASE_ )



      def A_			(			self ):
          return self.mean





import argparse
import json

import requests
import timm
import torch
from huggingface_hub import hf_hub_download
from PIL import Image

from transformers import AutoImageProcessor, SwinConfig, SwinForImageClassification





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase							):
    snake_case__						=				SwinConfig()
    snake_case__						=				swin_name.split("_"							)

    snake_case__						=				name_split[1]
    snake_case__						=				int(name_split[4]							)
    snake_case__						=				int(name_split[3][-1]							)

    if model_size == "tiny":
        snake_case__						=				96
        snake_case__						=				(2, 2, 6, 2)
        snake_case__						=				(3, 6, 12, 24)
    elif model_size == "small":
        snake_case__						=				96
        snake_case__						=				(2, 2, 18, 2)
        snake_case__						=				(3, 6, 12, 24)
    elif model_size == "base":
        snake_case__						=				128
        snake_case__						=				(2, 2, 18, 2)
        snake_case__						=				(4, 8, 16, 32)
    else:
        snake_case__						=				192
        snake_case__						=				(2, 2, 18, 2)
        snake_case__						=				(6, 12, 24, 48)

    if "in22k" in swin_name:
        snake_case__						=				21_841
    else:
        snake_case__						=				1_000
        snake_case__						=				"huggingface/label-files"
        snake_case__						=				"imagenet-1k-id2label.json"
        snake_case__						=				json.load(open(hf_hub_download(__lowerCAmelCase    ,		__lowerCAmelCase    ,		repo_type="dataset"							)    ,		"r"							)							)
        snake_case__						=				{int(__lowerCAmelCase							): v for k, v in idalabel.items()}
        snake_case__						=				idalabel
        snake_case__						=				{v: k for k, v in idalabel.items()}

    snake_case__						=				img_size
    snake_case__						=				num_classes
    snake_case__						=				embed_dim
    snake_case__						=				depths
    snake_case__						=				num_heads
    snake_case__						=				window_size

    return config





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase							):
    if "patch_embed.proj" in name:
        snake_case__						=				name.replace("patch_embed.proj"    ,		"embeddings.patch_embeddings.projection"							)
    if "patch_embed.norm" in name:
        snake_case__						=				name.replace("patch_embed.norm"    ,		"embeddings.norm"							)
    if "layers" in name:
        snake_case__						=				"encoder." + name
    if "attn.proj" in name:
        snake_case__						=				name.replace("attn.proj"    ,		"attention.output.dense"							)
    if "attn" in name:
        snake_case__						=				name.replace("attn"    ,		"attention.self"							)
    if "norm1" in name:
        snake_case__						=				name.replace("norm1"    ,		"layernorm_before"							)
    if "norm2" in name:
        snake_case__						=				name.replace("norm2"    ,		"layernorm_after"							)
    if "mlp.fc1" in name:
        snake_case__						=				name.replace("mlp.fc1"    ,		"intermediate.dense"							)
    if "mlp.fc2" in name:
        snake_case__						=				name.replace("mlp.fc2"    ,		"output.dense"							)

    if name == "norm.weight":
        snake_case__						=				"layernorm.weight"
    if name == "norm.bias":
        snake_case__						=				"layernorm.bias"

    if "head" in name:
        snake_case__						=				name.replace("head"    ,		"classifier"							)
    else:
        snake_case__						=				"swin." + name

    return name





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase							):
    for key in orig_state_dict.copy().keys():
        snake_case__						=				orig_state_dict.pop(__lowerCAmelCase							)

        if "mask" in key:
            continue
        elif "qkv" in key:
            snake_case__						=				key.split("."							)
            snake_case__						=				int(key_split[1]							)
            snake_case__						=				int(key_split[3]							)
            snake_case__						=				model.swin.encoder.layers[layer_num].blocks[block_num].attention.self.all_head_size

            if "weight" in key:
                snake_case__						=				val[:dim, :]
                snake_case__						=				val[
                    dim : dim * 2, :
                ]
                snake_case__						=				val[-dim:, :]
            else:
                snake_case__						=				val[
                    :dim
                ]
                snake_case__						=				val[
                    dim : dim * 2
                ]
                snake_case__						=				val[
                    -dim:
                ]
        else:
            snake_case__						=				val

    return orig_state_dict





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase							):
    snake_case__						=				timm.create_model(__lowerCAmelCase    ,		pretrained=__lowerCAmelCase							)
    timm_model.eval()

    snake_case__						=				get_swin_config(__lowerCAmelCase							)
    snake_case__						=				SwinForImageClassification(__lowerCAmelCase							)
    model.eval()

    snake_case__						=				convert_state_dict(timm_model.state_dict()    ,		__lowerCAmelCase							)
    model.load_state_dict(__lowerCAmelCase							)

    snake_case__						=				"http://images.cocodataset.org/val2017/000000039769.jpg"

    snake_case__						=				AutoImageProcessor.from_pretrained("microsoft/{}".format(swin_name.replace("_"    ,		"-"							)							)							)
    snake_case__						=				Image.open(requests.get(__lowerCAmelCase    ,		stream=__lowerCAmelCase							).raw							)
    snake_case__						=				image_processor(images=__lowerCAmelCase    ,		return_tensors="pt"							)

    snake_case__						=				timm_model(inputs["pixel_values"]							)
    snake_case__						=				model(**__lowerCAmelCase							).logits

    assert torch.allclose(__lowerCAmelCase    ,		__lowerCAmelCase    ,		atol=1E-3							)

    print(F"""Saving model {swin_name} to {pytorch_dump_folder_path}"""							)
    model.save_pretrained(__lowerCAmelCase							)

    print(F"""Saving image processor to {pytorch_dump_folder_path}"""							)
    image_processor.save_pretrained(__lowerCAmelCase							)


if __name__ == "__main__":
     __magic_name__            =  argparse.ArgumentParser()
     # Required parameters
     parser.add_argument(
         '''--swin_name''',
         default='''swin_tiny_patch4_window7_224''',
         type=str,
         help='''Name of the Swin timm model you\'d like to convert.''',
     )
     parser.add_argument(
         '''--pytorch_dump_folder_path''', default=None, type=str, help='''Path to the output PyTorch model directory.'''
     )

     __magic_name__            =  parser.parse_args()
     convert_swin_checkpoint(args.swin_name, args.pytorch_dump_folder_path)



