File tree 3 files changed +23
-1
lines changed 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 5
5
from keras_core import losses
6
6
from keras_core import metrics
7
7
from keras_core import optimizers
8
+ import keras_core as keras
9
+
10
+ keras .config .disable_traceback_filtering ()
8
11
9
12
inputs = layers .Input ((100 ,))
10
13
x = layers .Dense (512 , activation = "relu" )(inputs )
Original file line number Diff line number Diff line change
1
+ from keras_core import backend
2
+ from keras_core .api_export import keras_core_export
3
+
4
+ if backend .backend () == "tensorflow" :
5
+ BackendVariable = backend .tensorflow .core .Variable
6
+ elif backend .backend () == "jax" :
7
+ BackendVariable = backend .jax .core .Variable
8
+ elif backend .backend () == "torch" :
9
+ BackendVariable = backend .torch .core .Variable
10
+ elif backend .backend () == "numpy" :
11
+ from keras_core .backend .numpy .core import Variable as NumpyVariable
12
+
13
+ BackendVariable = NumpyVariable
14
+ else :
15
+ raise RuntimeError ("Invalid backend." )
16
+
17
+
18
+ @keras_core_export ("keras_core.backend.Variable" )
19
+ class Variable (BackendVariable ):
20
+ pass
Original file line number Diff line number Diff line change @@ -184,7 +184,6 @@ def get_json_type(obj):
184
184
# return obj.__wrapped__
185
185
186
186
if tf .available and isinstance (obj , tf .TypeSpec ):
187
-
188
187
from tensorflow .python .framework import type_spec_registry
189
188
190
189
try :
You can’t perform that action at this time.
0 commit comments