1- #!/usr/bin/env python3
1+ #! /usr/bin/python
22# -*- coding: utf-8 -*-
33
44import numpy as np
@@ -50,10 +50,6 @@ class QuanConv2dWithBN(Layer):
5050 The bits of this layer's parameter
5151 bitA : int
5252 The bits of the output of previous layer
53- epsilon : float
54- Eplison.
55- is_train : boolean
56- Is being used for training or inference.
5753 use_gemm : boolean
5854 If True, use gemm instead of ``tf.matmul`` for inferencing. (TODO).
5955 W_init : initializer
@@ -62,6 +58,10 @@ class QuanConv2dWithBN(Layer):
6258 The arguments for the weight matrix initializer.
6359 data_format : str
6460 "NHWC" or "NCHW", default is "NHWC".
61+ dilation_rate : tuple of int
62+ Specifying the dilation rate to use for dilated convolution.
63+ in_channels : int
64+ The number of in channels.
6565 name : str
6666 A unique layer name.
6767
@@ -98,7 +98,6 @@ def __init__(
9898 name = 'quan_cnn2d_bn' ,
9999 ):
100100 super (QuanConv2dWithBN , self ).__init__ (act = act , name = name )
101- # self.prev_layer = prev_layer
102101 self .n_filter = n_filter
103102 self .filter_size = filter_size
104103 self .strides = strides
@@ -133,7 +132,7 @@ def __repr__(self):
133132 actstr = self .act .__name__ if self .act is not None else 'No Activation'
134133 s = (
135134 '{classname}(in_channels={in_channels}, out_channels={n_filter}, kernel_size={filter_size}'
136- ', strides={strides}, padding={padding}' + actstr
135+ ', strides={strides}, padding={padding}' + actstr
137136 )
138137 if self .dilation_rate != (1 , ) * len (self .dilation_rate ):
139138 s += ', dilation={dilation_rate}'
0 commit comments