code: def set_layer_lr_decay(self, layer_lr_decay):
      decay_rate = layer_lr_decay
  
      # layers -> blocks (depth)
      depth = sum(self.depths)
      lr_scales = [decay_rate ** (depth - i - 1) for i in range(depth)]
  
      def _set_lr_scale(m, scale):
          for p in m.parameters():
              p.lr_scale = scale
  
      self.patch_embed.apply(lambda x: _set_lr_scale(x, lr_scales[0]))
      i = 0
      for layer in self.layers:
          for block in layer.blocks:
              block.apply(lambda x: _set_lr_scale(x, lr_scales[i]))
              i += 1
          if layer.downsample is not None:
              layer.downsample.apply(
                  lambda x: _set_lr_scale(x, lr_scales[i - 1])
              )
      assert i == depth
      for m in [self.norm_head, self.head]:
          m.apply(lambda x: _set_lr_scale(x, lr_scales[-1]))
  
      for k, p in self.named_parameters():
          p.param_name = k
  
      def _check_lr_scale(m):
          for p in m.parameters():
              assert hasattr(p, "lr_scale"), p.param_name
  
imports: import itertools
  import paddle
  from paddle import nn
  from paddle.nn import functional
  from .common import LayerNorm2d
label_desc: Use image node_id 2 for calling the TinyViT obj's underlying member method code with example usage: obj.set_layer_lr_decay(layer_lr_decay) without return types