class_docstr: The :class:`BinaryConv2d` class is a 2D binary CNN layer, which weights are either -1 or 1 while inference.
  
  Note that, the bias vector would not be binarized.
  
  Parameters
  ----------
  n_filter : int
      The number of filters.
  filter_size : tuple of int
      The filter size (height, width).
  strides : tuple of int
      The sliding window strides of corresponding input dimensions.
      It must be in the same order as the ``shape`` parameter.
  act : activation function
      The activation function of this layer.
  padding : str
      The padding algorithm type: "SAME" or "VALID".
  use_gemm : boolean
      If True, use gemm instead of ``tf.matmul`` for inference.
      TODO: support gemm
  data_format : str
      "channels_last" (NHWC, default) or "channels_first" (NCHW).
  dilation_rate : tuple of int
      Specifying the dilation rate to use for dilated convolution.
  W_init : initializer
      The initializer for the the weight matrix.
  b_init : initializer or None
      The initializer for the the bias vector. If None, skip biases.
  in_channels : int
      The number of in channels.
  name : None or str
      A unique layer name.
  
  Examples
  ---------
  With TensorLayer
  
  >>> net = tl.layers.Input([8, 100, 100, 32], name='input')
  >>> binaryconv2d = tl.layers.QuanConv2d(
  ...     n_filter=64, filter_size=(3, 3), strides=(2, 2), act=tf.nn.relu, in_channels=32, name='binaryconv2d'
  ... )(net)
  >>> print(binaryconv2d)
  >>> output shape : (8, 50, 50, 64)
code: def build(self, inputs_shape):
      if self.data_format == "channels_last":
          self.data_format = "NHWC"
          if self.in_channels is None:
              self.in_channels = inputs_shape[-1]
          self._strides = [1, self._strides[0], self._strides[1], 1]
          self._dilation_rate = [
              1,
              self._dilation_rate[0],
              self._dilation_rate[1],
              1,
          ]
      elif self.data_format == "channels_first":
          self.data_format = "NCHW"
          if self.in_channels is None:
              self.in_channels = inputs_shape[1]
          self._strides = [1, 1, self._strides[0], self._strides[1]]
          self._dilation_rate = [
              1,
              1,
              self._dilation_rate[0],
              self._dilation_rate[1],
          ]
      else:
          raise Exception(
              "data_format should be either channels_last or channels_first"
          )
  
      self.filter_shape = (
          self.filter_size[0],
          self.filter_size[1],
          self.in_channels,
          self.n_filter,
      )
  
      self.W = self._get_weights(
          "filters", shape=self.filter_shape, init=self.W_init
      )
      if self.b_init:
          self.b = self._get_weights(
              "biases", shape=(self.n_filter,), init=self.b_init
          )
  
file_path: TensorLayer/tensorlayer/layers/convolution/binary_conv.py
imports: import tensorflow
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated_alias
  from tensorlayer.layers.core import Layer
  from tensorlayer.layers.utils import quantize
label_desc: Use image node_id 3 for calling the BinaryConv2d obj's underlying member method code with example usage: obj.build(inputs_shape) without return types