class_docstr: DepthwiseSeparable block
  Used for DS convs in MobileNet-V1 and in the place of IR blocks that have no expansion
  (factor of 1.0). This is an alternative to having a IR with an optional first pw conv.
class_docstr_tok: ["DepthwiseSeparable","block","Used","for","DS","convs","in","MobileNet-V1","and","in","the","place","of","IR","blocks","that","have","no","expansion","(","factor","of","1.0",")",".","This","is","an","alternative","to","having","a","IR","with","an","optional","first","pw","conv","."]
code: def __init__(
      self,
      in_chs,
      out_chs,
      dw_kernel_size=3,
      stride=1,
      dilation=1,
      group_size=1,
      pad_type="",
      noskip=False,
      pw_kernel_size=1,
      pw_act=False,
      act_layer=nn.ReLU,
      norm_layer=nn.BatchNorm2d,
      se_layer=None,
      drop_path_rate=0.0,
  ):
      super(DepthwiseSeparableConv, self).__init__()
      norm_act_layer = get_norm_act_layer(norm_layer, act_layer)
      groups = num_groups(group_size, in_chs)
      self.has_skip = (stride == 1 and in_chs == out_chs) and not noskip
      self.has_pw_act = pw_act  # activation after point-wise conv
  
      self.conv_dw = create_conv2d(
          in_chs,
          in_chs,
          dw_kernel_size,
          stride=stride,
          dilation=dilation,
          padding=pad_type,
          groups=groups,
      )
      self.bn1 = norm_act_layer(in_chs, inplace=True)
  
      # Squeeze-and-excitation
      self.se = (
          se_layer(in_chs, act_layer=act_layer)
          if se_layer
          else nn.Identity()
      )
  
      self.conv_pw = create_conv2d(
          in_chs, out_chs, pw_kernel_size, padding=pad_type
      )
      self.bn2 = norm_act_layer(
          out_chs, inplace=True, apply_act=self.has_pw_act
      )
      self.drop_path = (
          DropPath(drop_path_rate) if drop_path_rate else nn.Identity()
      )
  
imports: import torch
  import torch.nn
  from torch.nn import functional
  from timm.layers import create_conv2d, DropPath, make_divisible, create_act_layer, get_norm_act_layer
label_desc: Use image node_id 1 to create a new DepthwiseSeparableConv object from inherited base classes: nn with example: obj = DepthwiseSeparableConv(in_chs, out_chs, dw_kernel_size, stride, dilation, group_size, pad_type, noskip, pw_kernel_size, pw_act, act_layer, norm_layer, se_layer, drop_path_rate)