message: Use correct dtype for resource vars in SymGrad instead of defaulting to float32.
diff: @@ -306,7 +306,7 @@ def _IsPartitionedCall(op):
  def _SymGrad(op, out_grads):
  """Backprop through a function call node op given its outputs' gradients."""
  f_in = [x for x in op.inputs] + out_grads
  - f_types = [x.dtype for x in op.inputs]
  + f_types = [default_gradient.get_zeros_dtype(x) for x in op.inputs]
  f = attr_value_pb2.NameAttrList()
  if _IsPartitionedCall(op):
  f.name = op.get_attr("f").name
  @@ -314,11 +314,7 @@ def _SymGrad(op, out_grads):
  f.name = op.type
  for k in op.node_def.attr:
  f.attr[k].CopyFrom(op.node_def.attr[k])
  - # TODO(apassos) use a better dtype here
  - in_grads = functional_ops.symbolic_gradient(
  - input=f_in,
  - Tout=[x if x != dtypes.resource else dtypes.float32 for x in f_types],
  - f=f)
  + in_grads = functional_ops.symbolic_gradient(input=f_in, Tout=f_types, f=f)
  return in_grads
  