class_docstr: This is copied from 🐸TTS to remove it from the dependencies.
code: def create_layer(self, block, planes, blocks, stride=1):
      downsample = None
      if stride != 1 or self.inplanes != planes * block.expansion:
          downsample = nn.Sequential(
              nn.Conv2d(
                  self.inplanes,
                  planes * block.expansion,
                  kernel_size=1,
                  stride=stride,
                  bias=False,
              ),
              nn.BatchNorm2d(planes * block.expansion),
          )
  
      layers = []
      layers.append(block(self.inplanes, planes, stride, downsample))
      self.inplanes = planes * block.expansion
      for _ in range(1, blocks):
          layers.append(block(self.inplanes, planes))
  
      return nn.Sequential(*layers)
  
imports: import torch
  import torchaudio
  from torch import nn
  from torch.nn import Conv1d, ConvTranspose1d
  from torch.nn import functional
  from torch.nn.utils.parametrizations import weight_norm
  from torch.nn.utils.parametrize import remove_parametrizations
  from TTS.utils.io import load_fsspec
label_desc: Use image node_id 3 for calling the ResNetSpeakerEncoder obj's underlying member method code with example usage: obj.create_layer(block, planes, blocks, stride) and returns: nn