import tensorflow as tf

            assert(data_format == 'NCHW' or data_format == 'NHWC')
            self.w = tf.get_variable('w', [k_h, k_w, input_dim, channel_multiplier],
                                initializer=tf.truncated_normal_initializer(stddev=stddev))
            self.b = tf.get_variable('b',[input_dim*channel_multiplier], initializer=tf.constant_initializer(0.0))
            if( data_format == 'NCHW' ) :
                self.strides = [1, 1, d_h, d_w]
            else :
                self.strides = [1, d_h, d_w, 1]
            self.data_format = data_format
            self.padding = padding
    def __call__(self,input_var,name=None,**xargs) :
        return tf.nn.bias_add(
                    tf.nn.depthwise_conv2d(input_var, self.w,
                                data_format=self.data_format,
                                strides=self.strides, padding=self.padding),
                    self.b,data_format=self.data_format,name=name)

class Conv3d(object) :
    def __init__(self,name,input_dim,output_dim,k_t=2,k_h=4,k_w=4,d_t=1,d_h=1,d_w=1,
                 stddev=0.02, data_format='NDHWC') :
        with tf.variable_scope(name) :
            assert(data_format == 'NDHWC')
            self.w = tf.get_variable('w', [k_t, k_h, k_w, input_dim, output_dim],
                                initializer=tf.truncated_normal_initializer(stddev=stddev))
