def METHOD_NAME(self, input_shape):
    input_shape = tf.TensorShape(input_shape).as_list()
    if not input_shape:
        output_shape = tf.TensorShape([1])
    else:
        output_shape = [input_shape[0]]
    if np.all(input_shape[1:]):
        output_shape += [np.prod(input_shape[1:], dtype=int)]
    else:
        output_shape += [None]
    return tf.TensorShape(output_shape)