message: BUG: initializer should supports TensorShape
diff: @@ -38,6 +38,7 @@ import numpy as np
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  +from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import linalg_ops_impl
  from tensorflow.python.ops import gen_linalg_ops
  @@ -539,7 +540,8 @@ class Orthogonal(Initializer):
  num_rows = 1
  for dim in shape[:-1]:
  num_rows *= dim
  - num_cols = shape[-1]
  + num_rows = int(num_rows)
  + num_cols = int(shape[-1])
  flat_shape = (num_cols, num_rows) if num_rows < num_cols else (num_rows,
  num_cols)
  @@ -1107,6 +1109,8 @@ class Identity(Initializer):
  "Identity matrix initializer can only be used for 2D matrices.")
  if dtype is None:
  dtype = self.dtype
  + if isinstance(full_shape, tensor_shape.TensorShape):
  + full_shape = full_shape.as_list()
  initializer = linalg_ops_impl.eye(*full_shape, dtype=dtype)
  if partition_info is not None:
  initializer = array_ops.slice(initializer, partition_info.var_offset,
  @@ -1287,7 +1291,7 @@ def _compute_fans(shape):
  shape: Integer shape tuple or TF tensor shape.
  Returns:
  - A tuple of scalars (fan_in, fan_out).
  + A tuple of integer scalars (fan_in, fan_out).
  """
  if len(shape) < 1: # Just to avoid errors for constants.
  fan_in = fan_out = 1
  @@ -1299,12 +1303,12 @@ def _compute_fans(shape):
  else:
  # Assuming convolution kernels (2D, 3D, or more).
  # kernel shape: (..., input_depth, depth)
  - receptive_field_size = 1.
  + receptive_field_size = 1
  for dim in shape[:-2]:
  receptive_field_size *= dim
  fan_in = shape[-2] * receptive_field_size
  fan_out = shape[-1] * receptive_field_size
  - return fan_in, fan_out
  + return int(fan_in), int(fan_out)
  def _assert_float_dtype(dtype):
  