Use tf.eye(), instead of np.eye()
Resolves
@@ -725,7 +725,10 @@ def eye(size, dtype=None, name=None):
```
"""
- return variable(np.eye(size), dtype, name)
+ if dtype is None:
+ dtype = floatx()
+ tf_dtype = tf.as_dtype(dtype)
+ return variable(tf.eye(size, dtype=tf_dtype), dtype, name)
def zeros_like(x, dtype=None, name=None):
