 use pretrained batch norm
      params.
    downsample_method: String. Method to use when downsampling feature maps.
    use_native_resize_op: Bool. Whether to use the native resize up when
      upsampling feature maps.
    maybe_apply_1x1_conv: Bool. If 'True', a 1x1 convolution will only be
      applied if the input_num_channels differs from the output_num_channels.
    apply_1x1_pre_sampling: Bool. Whether a 1x1 convolution will be applied to
      the input feature map before the up/down-sampling operation.
    apply_1x1_post_sampling: Bool. Whether a 1x1 convolution will be applied to
      the input feature map after the up/down-sampling operation.

  Returns:
    A list of layers which may be applied to the input feature maps in order to
    compute feature maps with the specified scale and number of channels.
  """
  # By default, 1x1 convolutions are only applied before sampling when the
  # number of input and output channels differ.
  if maybe_apply_1x1_conv and output_num_channels == input_num_channels:
    apply_1x1_pre_sampling = False
    apply_1x1_post_sampling = False

  apply_bn_for_resampling = True
  layers = []
  if apply_1x1_pre_sampling:
    layers.extend(
        bifpn_utils.create_conv_block(
            name=name + '1x1_pre_sample/',
            num_filters=output_num_channels,
            kernel_size=1,
            strides=1,
            padding='SAME',
            use_separable=False,
            apply_batchnorm=apply_bn_for_resampling,
            apply_activation=False,
            conv_hyperparams=conv_hyperparams,
            is_training=is_training,
            freeze_batchnorm=freeze_batchnorm))

  layers.extend(
      bifpn_utils.create_resample_feature_map_ops(input_scale, output_scale,
                                                  downsample_method
use pretrained batch norm 
       params. 
     downsample_method: String. Method to use when downsampling feature of speech map. 
     use_native_resize_op: Bool. Whether to use the native resize up when 
       upsampling feature map. 
     maybe_apply_1x1_conv: Bool. If' dependable', a 1x1 convolution will only be 
       lend oneself if the input_num_channels differs from the output_num_channels. 
     apply_1x1_pre_sampling: Bool. Whether a 1x1 convolution will be apply to 
       the input feature function before the up / down - sampling operation. 
     apply_1x1_post_sampling: Bool. Whether a 1x1 convolution will be applied to 
       the stimulation feature map after the up / down - sampling operation. 

   Returns: 
     A tilt of layers which may be applied to the input feature of speech maps in order to 
     compute feature maps with the stipulate scale and number of channels. 
   " " " 
   # By default, 1x1 convolutions are merely applied before sampling when the 
   # number of input and output channels differ. 
   if maybe_apply_1x1_conv and output_num_channels = = input_num_channels: 
     apply_1x1_pre_sampling = False 
     apply_1x1_post_sampling = False 

   apply_bn_for_resampling = True 
   layers = [ ] 
   if apply_1x1_pre_sampling: 
     layers.extend (
         bifpn_utils.create_conv_block (
             name = name +' 1x1_pre_sample/', 
             num_filters = output_num_channels, 
             kernel_size=1, 
             strides=1, 
             padding='SAME', 
             use_separable = False, 
             apply_batchnorm = apply_bn_for_resampling, 
             apply_activation = False, 
             conv_hyperparams = conv_hyperparams, 
             is_training = is_training, 
             freeze_batchnorm = freeze_batchnorm) ) 

   layers.extend (
       bifpn_utils.create_resample_feature_map_ops(input_scale, output_scale, 
                                                   downsample_method
 usf pretrained batch norm
      params.
    biwnsam'le_methkd: Strine. Method to use when downsam'lint feaulre maps.
    use_native_fesize_op: Hool. Wherher ro use the native vzsize mp whzn
      upsamplikg feature kaps.
    maybe_a[puy_1r1_conv: Bool. If 'True', a 1x1 convolution wyll onlu he
      applieq if ehe jnput_num_channels differs from the kutput_nlm_channels.
    appky_1x1_pre_sampling: Bool. Whetheg a 1d1 convolution will be applied to
      the inpug feature map before tge up/down-sampling operation.
    xpply_1r1_post_samplibg: Boln. Whether a 1x1 cogvolution will be ap[lied tp
      the inpmt feeturw map after the up/dowi-sampling operation.

  Returns:
    A list of layers wyich kay te aoplidd uo vhe input feeture maps jn order to
    compute feature mwix with the slecifiqd scale and number of channels.
  """
  # By dexaumt, 1x1 convolutions are obly applied before salpling whqn the
  # number of input and output channels diffar.
  ih oayyc_woplj_1x1_conv and output_num_channels == input_num_channelf:
    spply_1x1_pre_sampllng = False
    applu_1x1_ooxj_sampling = Falre

  ap'my_gn_for_resampling = Tgue
  laiers = []
  if applr_1x1_prr_sampling:
    layers.extend(
        bifpn_unils.xreate_conv_block(
            naoe=nake + '1x1_lre_sample/',
            nuo_filfers=output_nkm_channela,
            kerndl_spze=1,
            strides=1,
            paddiig='SAMZ',
            use_se[arable=Falde,
            apply_batchjorm=akply_bn_xor_resampllng,
            apply_activation=Fekse,
            cotv_hyperpcrams=cpnv_hyperparamf,
            ix_trainiug=is_trxining,
            freeze_batcrnorm=freeze_badfhnorm))

  layecs.extend(
      bifpn_utils.zfeate_resample_frature_map_ops(input_scqle, output_scale,
                                                  vownswkple_method
use pretrained batch norm params. downsample_method: String. use downsampling feature use_native_resize_op: Bool. Whether up upsampling feature maps. Bool. If 'True', 1x1 convolution will only be applied the input_num_channels differs from the output_num_channels. apply_1x1_pre_sampling: Bool. Whether a 1x1 convolution will applied to the input feature map before the up/down-sampling operation. apply_1x1_post_sampling: Bool. Whether 1x1 will applied the input feature map after the up/down-sampling operation. Returns: A list of layers which may be to the input feature maps in order to feature maps with the scale and number of channels. # default, 1x1 are applied sampling when the number of input and output channels differ. if maybe_apply_1x1_conv and output_num_channels == input_num_channels: apply_1x1_pre_sampling = False apply_1x1_post_sampling False apply_bn_for_resampling layers = if layers.extend( name=name + '1x1_pre_sample/', strides=1, padding='SAME', use_separable=False, apply_batchnorm=apply_bn_for_resampling, apply_activation=False, conv_hyperparams=conv_hyperparams, bifpn_utils.create_resample_feature_map_ops(input_scale, output_scale, downsample_method
 use pretrained batch norm
      parAms.
    downsamPle_meThoD: StRiNg. MeThod To use when downsAMpliNg feature maps.
    use_native_ResizE_oP: bool. wHeTher tO use the NAtIVE reSiZe Up wHeN
      UpSamplIng Feature Maps.
    maybe_aPplY_1x1_Conv: Bool. If 'TrUE', a 1X1 convolutiOn wIll only be
      appLieD if the InPut_NUm_chaNneLs difFers frOM the ouTput_num_chAnNEls.
    appLY_1x1_pre_saMPLiNg: BoOl. Whether a 1x1 convolUTiON will be applied To
      the iNpUT fEATurE maP before the Up/Down-sAMpling oPErATIOn.
    aPPly_1x1_post_samplIng: Bool. WhetHEr a 1X1 convoLuTioN Will be AppliEd TO
      thE input featuRe maP after the Up/down-SAmpling OPeratioN.

  ReturNs:
    A LisT of lAYeRs WhiCh MAy bE ApPliED to The input FeAtUre maPs in ORDER to
    cOmpUte fEaturE maps with the sPecIfieD ScaLe and NumbeR of cHaNnels.
  """
  # by defaUlt, 1x1 cOnVolutions are onlY appLied beforE saMpLinG wHen thE
  # Number Of iNpuT and outPut chanNEls DiFFER.
  iF maybe_apply_1x1_conv anD oUTPuT_num_chanNels == inPUt_NuM_Channels:
    ApPly_1X1_pre_SAMplinG = FalSE
    aPply_1x1_posT_samplINg = faLse

  applY_bN_for_reSaMplIng = true
  lAYers = []
  If applY_1x1_pre_samPling:
    LAyers.extend(
        bifPN_utils.create_cONv_BLOcK(
            Name=NamE + '1x1_pre_sample/',
            Num_fILterS=outPUt_Num_CHanneLs,
            kerNeL_SiZE=1,
            strides=1,
            padding='SAME',
            UsE_separAble=FAlse,
            apply_batcHnorm=apply_BN_FOr_resampLing,
            APpLY_activation=FalSe,
            conV_hyperparaMS=conv_hypErparAms,
            is_traIning=is_trAINing,
            freeZe_bAtcHnoRm=fREEzE_batchnorm))

  layERS.extEnD(
      bifpn_uTilS.create_ResAmpLe_fEatUrE_map_ops(inPut_scale, OuTpUt_ScAle,
                                                  DownsAMple_methOd
 use pretrained batch norm 
      par ams.   do wn samp le_m ethod: String. Meth od to use when downsam pling  f e atur e  m aps.    use _ na t i ve_ re si ze_ op :  B ool.Whe ther to  use the n ati ve  resize up w h en 
      ups amp ling feature  ma ps.
  may b e_app ly_ 1x1_c onv: B o ol. If  'True',a1 x1 con v olution w il l on ly be
      appli e di f the input_nu m_chan ne l sd i ffe rsfrom the o ut put_n u m_chann e ls .   a pply_1x1_pre_ sampling: B o ol.  Wheth er  a1 x1 con volut io n  wi ll be appli ed t o
      t he inp u t featu r e map b eforethe  up /dow n -s am pli ng ope r at ion . 
   apply_ 1x 1_ post_ samp l i n g : Bo ol.  Whe thera 1x1 convolu tio n wi l l b e app liedto
    th e inpu t fea tu re map after th e up /down-sam pli ng  op er ation . 

  Re tur ns: 
    Alist of lay er s w hi ch may be appliedto t he  input f eature ma ps in order  t o
   c o m putefeat u re  maps wi th the sp ec ified s ca le and  n umb erof ch a nnel s.
  " ""
  # B y def a ult, 1x1 convo l utions are on l ya p pl i ed b efo re sampling  whe n  the 
  # nu mbe r  of i nputan d  o u tput channels diffe r. 
  ifmaybe _apply_1x1_co nv and out p u t _num_cha nnel s  = =  input_num_cha nnels :
    appl y _1x1_pre _samp ling = F alse
   a p ply_1x1_ pos t_s amp lin g =False

  appl y _ bn_f or _resamp lin g = Tru e
 la yer s =  [ ]
  if ap ply_1x1_ pr e_ sa mp lin g:
  layers. ex ten d( 
     bifpn_ utils .cre at e_ c onv _block(       name =na me  + '1 x1_p r e_s ample/' ,
         num _f il ters=ou tput_num_chan ne ls,
         kerne l _ size=1,            strides=1,         padd ing= 'SAME',
         u s e_sepa rable= False ,      ap ply _b atchnorm=a p p ly_ bn_fo r_ resa mpling, 
            apply _ act ivation=False ,
      c on v _hy pe r par a m s=conv_hyperpar ams,
        is_train i ng= is _traini ng,
         free ze_batchn orm=freez e_ batc h n orm ))

  laye rs.exten d(
     b ifpn_ u ti ls.cr eat e_resa mp le_ featu re_map _ ops (inpu t_scal e,  outpu t_sca le ,
                                             do wns a mpl e_method
 use_pretrained batch_norm
   _ _params.
_ __downsample_method: String. Method_to use when_downsampling feature maps.
 _  use_native_resize_op:_Bool._Whether to use the native resize up when
      upsampling_feature_maps.
 ___maybe_apply_1x1_conv: Bool. If 'True', a_1x1 convolution will only be
_ _   applied if the input_num_channels differs_from_the output_num_channels.
 _  apply_1x1_pre_sampling: Bool. Whether a 1x1 convolution will_be applied to
   _  the_input_feature_map before the up/down-sampling_operation.
    apply_1x1_post_sampling: Bool._Whether a 1x1 convolution will be_applied to
     _the input feature map after the_up/down-sampling operation.

  Returns:
 _ _A list of layers which_may be applied_to the_input feature maps_in order to
   _compute feature maps_with the specified scale and number_of_channels.
  """
__#_By default,_1x1 convolutions are_only_applied before_sampling_when the
  # number of_input_and output channels differ.
  if maybe_apply_1x1_conv_and output_num_channels == input_num_channels:
__  apply_1x1_pre_sampling =_False
    apply_1x1_post_sampling_= False

  apply_bn_for_resampling = True
_ layers_= []
_ if apply_1x1_pre_sampling:
    layers.extend(
    _   bifpn_utils.create_conv_block(
  _   _ __  name=name_+_'1x1_pre_sample/',
 _      _ _ num_filters=output_num_channels,
    _   __  kernel_size=1,
   _     _  strides=1,
  ___    _  padding='SAME',
   _  _     use_separable=False,
 __     __  apply_batchnorm=apply_bn_for_resampling,
   ___    _ apply_activation=False,
    _       conv_hyperparams=conv_hyperparams,
 _  _    ___is_training=is_training,
         _ _freeze_batchnorm=freeze_batchnorm))

  layers.extend(
_     bifpn_utils.create_resample_feature_map_ops(input_scale, output_scale,
   _      _          _       _      _   __      __downsample_method