Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/cdtools/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,13 @@ def update(idx):
updating = True if len(axes[0].images) >= 1 else False

inputs, output = dataset[idx:idx+1]
sim_data = self.forward(*inputs).detach().cpu().numpy()[0]
sim_data = self.forward(*inputs).detach().cpu().numpy()
# The length of sim_data.shape changes when you're doing
# either a ptycho (3) or an RPI (2) reconstruction.
# We need to make sure that sim_data is 2D.
if len(sim_data.shape) > 2:
sim_data = sim_data[0]

meas_data = output.detach().cpu().numpy()[0]
if hasattr(self, 'mask') and self.mask is not None:
mask = self.mask.detach().cpu().numpy()
Expand Down