class_docstr: Separable/Depthwise Convolutional 2D layer, see `tf.nn.depthwise_conv2d <https://tensorflow.google.cn/versions/r2.0/api_docs/python/tf/nn/depthwise_conv2d>`__.
  
  Input:
      4-D Tensor (batch, height, width, in_channels).
  Output:
      4-D Tensor (batch, new height, new width, in_channels * depth_multiplier).
  
  Parameters
  ------------
  filter_size : tuple of 2 int
      The filter size (height, width).
  strides : tuple of 2 int
      The stride step (height, width).
  act : activation function
      The activation function of this layer.
  padding : str
      The padding algorithm type: "SAME" or "VALID".
  data_format : str
      "channels_last" (NHWC, default) or "channels_first" (NCHW).
  dilation_rate: tuple of 2 int
      The dilation rate in which we sample input values across the height and width dimensions in atrous convolution. If it is greater than 1, then all values of strides must be 1.
  depth_multiplier : int
      The number of channels to expand to.
  W_init : initializer
      The initializer for the weight matrix.
  b_init : initializer or None
      The initializer for the bias vector. If None, skip bias.
  in_channels : int
      The number of in channels.
  name : str
      A unique layer name.
  
  Examples
  ---------
  With TensorLayer
  
  >>> net = tl.layers.Input([8, 200, 200, 32], name='input')
  >>> depthwiseconv2d = tl.layers.DepthwiseConv2d(
  ...     filter_size=(3, 3), strides=(1, 1), dilation_rate=(2, 2), act=tf.nn.relu, depth_multiplier=2, name='depthwise'
  ... )(net)
  >>> print(depthwiseconv2d)
  >>> output shape : (8, 200, 200, 64)
  
  
  References
  -----------
  - tflearn's `grouped_conv_2d <https://github.com/tflearn/tflearn/blob/3e0c3298ff508394f3ef191bcd7d732eb8860b2e/tflearn/layers/conv.py>`__
  - keras's `separableconv2d <https://keras.io/layers/convolutional/#separableconv2d>`__
class_docstr_tok: ["Separable\/Depthwise","Convolutional","2D","layer",",","see","`","tf.nn.depthwise_conv2d","<","https",":","\/\/tensorflow.google.cn\/versions\/r2.0\/api_docs\/python\/tf\/nn\/depthwise_conv2d",">","`","__",".","Input",":","4-D","Tensor","(","batch",",","height",",","width",",","in_channels",")",".","Output",":","4-D","Tensor","(","batch",",","new","height",",","new","width",",","in_channels","*","depth_multiplier",")",".","Parameters","--","--","--","--","--","--","filter_size",":","tuple","of","2","int","The","filter","size","(","height",",","width",")",".","strides",":","tuple","of","2","int","The","stride","step","(","height",",","width",")",".","act",":","activation","function","The","activation","function","of","this","layer",".","padding",":","str","The","padding","algorithm","type",":","``","SAME","''","or","``","VALID","''",".","data_format",":","str","``","channels_last","''","(","NHWC",",","default",")","or","``","channels_first","''","(","NCHW",")",".","dilation_rate",":","tuple","of","2","int","The","dilation","rate","in","which","we","sample","input","values","across","the","height","and","width","dimensions","in","atrous","convolution",".","If","it","is","greater","than","1",",","then","all","values","of","strides","must","be","1.","depth_multiplier",":","int","The","number","of","channels","to","expand","to",".","W_init",":","initializer","The","initializer","for","the","weight","matrix",".","b_init",":","initializer","or","None","The","initializer","for","the","bias","vector",".","If","None",",","skip","bias",".","in_channels",":","int","The","number","of","in","channels",".","name",":","str","A","unique","layer","name",".","Examples","--","--","--","--","-","With","TensorLayer",">",">",">","net","=","tl.layers.Input","(","[","8",",","200",",","200",",","32","]",",","name='input","'",")",">",">",">","depthwiseconv2d","=","tl.layers.DepthwiseConv2d","(","...","filter_size=","(","3",",","3",")",",","strides=","(","1",",","1",")",",","dilation_rate=","(","2",",","2",")",",","act=tf.nn.relu",",","depth_multiplier=2",",","name='depthwise'","...",")","(","net",")",">",">",">","print","(","depthwiseconv2d",")",">",">",">","output","shape",":","(","8",",","200",",","200",",","64",")","References","--","--","--","--","--","-","-","tflearn","'s","`","grouped_conv_2d","<","https",":","\/\/github.com\/tflearn\/tflearn\/blob\/3e0c3298ff508394f3ef191bcd7d732eb8860b2e\/tflearn\/layers\/conv.py",">","`","__","-","keras","'s","`","separableconv2d","<","https",":","\/\/keras.io\/layers\/convolutional\/","#","separableconv2d",">","`","__"]
code: def __init__(
      self,
      filter_size=(3, 3),
      strides=(1, 1),
      act=None,
      padding="SAME",
      data_format="channels_last",
      dilation_rate=(1, 1),
      depth_multiplier=1,
      W_init=tl.initializers.truncated_normal(stddev=0.02),
      b_init=tl.initializers.constant(value=0.0),
      in_channels=None,
      name=None,  # 'depthwise_conv2d'
  ):
      super().__init__(name, act=act)
      self.filter_size = filter_size
      self.strides = self._strides = strides
      self.padding = padding
      self.dilation_rate = self._dilation_rate = dilation_rate
      self.data_format = data_format
      self.depth_multiplier = depth_multiplier
      self.W_init = W_init
      self.b_init = b_init
      self.in_channels = in_channels
  
      if self.in_channels:
          self.build(None)
          self._built = True
  
      logging.info(
          "DepthwiseConv2d %s: filter_size: %s strides: %s pad: %s act: %s"
          % (
              self.name,
              str(filter_size),
              str(strides),
              padding,
              self.act.__name__
              if self.act is not None
              else "No Activation",
          )
      )
  
file_path: TensorLayer/tensorlayer/layers/convolution/depthwise_conv.py
imports: import tensorflow
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated_alias
  from tensorlayer.layers.core import Layer
label_desc: Use image node_id 1 to create a new DepthwiseConv2d object from inherited base classes: Layer with example: obj = DepthwiseConv2d(filter_size, strides, act, padding, data_format, dilation_rate, depth_multiplier, W_init, b_init, in_channels, name)