Implemented infer_shape on cudnn ops.

Here shape should always be a list. In the forward op, it should be [shape[0]], in the backward, it should be [shape[1]]. I do not understand this condition and the else clause.