def METHOD_NAME(self, hist_matrix, vertical_dim, scope):
    """The main function to use CNN at both vertical and horizonal aspects.
    Args:
        hist_matrix (object): The output of history sequential embeddings
        vertical_dim (int): The shape of embeddings of input
        scope (object): The scope of CNN input.
    Returns:
        object: The output of CNN layers.
    """
    with tf.compat.v1.variable_scope(scope):
        with tf.compat.v1.variable_scope("vertical"):
            embedding_T = tf.transpose(a=hist_matrix, perm=[0, 2, 1])
            out_v = self._build_cnn(embedding_T, self.n_v, vertical_dim)
            out_v = tf.compat.v1.layers.flatten(out_v)
        with tf.compat.v1.variable_scope("horizonal"):
            out_hs = []
            for h in self.lengths:
                conv_out = self._build_cnn(hist_matrix, self.n_h, h)
                max_pool_out = tf.reduce_max(
                    input_tensor=conv_out, axis=[1], name="max_pool_{0}".format(h)
                )
                out_hs.append(max_pool_out)
            out_h = tf.concat(out_hs, 1)
    return tf.concat([out_v, out_h], 1)