Skip to content

Commit

Permalink
Remove device_put from new example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bwohlberg committed Nov 7, 2023
1 parent 000a2f7 commit b80e069
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions examples/scripts/ct_multi_cs_tv_admm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

import numpy as np

import jax

from xdesign import Foam, discrete_phantom

import scico.numpy as snp
Expand All @@ -38,8 +36,7 @@
"""
N = 512 # phantom size
np.random.seed(1234)
x_gt = discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N)
x_gt = jax.device_put(x_gt)
x_gt = snp.array(discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N))


"""
Expand Down
5 changes: 1 addition & 4 deletions examples/scripts/ct_multi_tv_admm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

import numpy as np

import jax

from xdesign import Foam, discrete_phantom

import scico.numpy as snp
Expand All @@ -37,8 +35,7 @@
"""
N = 512 # phantom size
np.random.seed(1234)
x_gt = discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N)
x_gt = jax.device_put(x_gt)
x_gt = snp.array(discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N))


"""
Expand Down
5 changes: 1 addition & 4 deletions examples/scripts/ct_tv_admm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

import numpy as np

import jax

from mpl_toolkits.axes_grid1 import make_axes_locatable
from xdesign import Foam, discrete_phantom

Expand All @@ -40,8 +38,7 @@
"""
N = 512 # phantom size
np.random.seed(1234)
x_gt = discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N)
x_gt = jax.device_put(x_gt) # convert to jax type, push to GPU
x_gt = snp.array(discrete_phantom(Foam(size_range=[0.075, 0.0025], gap=1e-3, porosity=1), size=N))


"""
Expand Down

0 comments on commit b80e069

Please sign in to comment.