Add a warning when doing infer_shape but when the inputs have dimensions of the same size.

This can hid error.
remove import not used detected by flymake
remove not used var.