Harcode backend in demo scripts

This commit is contained in:
Francois Chollet 2023-06-09 10:55:29 -07:00
parent cb80a1adbf
commit b261385bb7
2 changed files with 12 additions and 0 deletions

@ -1,3 +1,9 @@
# flake8: noqa
import os
# Set backend env to torch
os.environ["KERAS_BACKEND"] = "torch"
import torch
import torch.nn as nn
import torch.optim as optim
@ -5,6 +11,7 @@ from keras_core import layers
import keras_core
import numpy as np
# Model / data parameters
num_classes = 10
input_shape = (28, 28, 1)

@ -1,4 +1,9 @@
# flake8: noqa
import os
# Set backend env to torch
os.environ["KERAS_BACKEND"] = "torch"
import torch
import torch.nn as nn
import torch.optim as optim