def common_spec(x, y): return tensor_spec.TensorSpec(defun.common_shape(x.shape, y.shape), x.dtype, x.name)
def common_spec(x, y): common_shape = defun.common_shape(x.shape, y.shape) if isinstance(x, sparse_tensor.SparseTensorSpec): return sparse_tensor.SparseTensorSpec(common_shape, x.dtype) return tensor_spec.TensorSpec(common_shape, x.dtype, x.name)