message: Avoid doing an equality check on Tensor dimensions
diff: @@ -533,7 +533,8 @@ def _reshape_if_necessary(tensor, new_shape):
  new_shape = tuple(-1 if x is None else x for x in new_shape)
  cur_shape = tuple(x.value for x in tensor.get_shape().dims)
  if (len(new_shape) == len(cur_shape) and
  - all(d0 == d1 or d1 == -1 for d0, d1 in zip(cur_shape, new_shape))):
  + all(not isinstance(d1, ops.Tensor) and (d0 == d1 or d1 == -1)
  + for d0, d1 in zip(cur_shape, new_shape))):
  return tensor
  else:
  return array_ops.reshape(tensor, new_shape)
  