Use keras backend for identify initializer
@@ -284,7 +284,7 @@ class Identity(Initializer):
raise ValueError(
'Identity matrix initializer can only be used for 2D matrices.')
- return self.gain * np.eye(shape[0], shape[1])
+ return self.gain * K.eye((shape[0], shape[1]), dtype=dtype)
def get_config(self):
return {
