Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeili committed Dec 26, 2020
1 parent 05ae3a7 commit 1bfb1cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepchem/models/torch_models/torch_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def fit_generator(self,

# Execute the loss function, accumulating the gradients.

if len(inputs) == 1:
if isinstance(inputs, list) and len(inputs) == 1:
inputs = inputs[0]

optimizer.zero_grad()
Expand Down Expand Up @@ -524,7 +524,7 @@ def _predict(
inputs, _, _ = self._prepare_batch((inputs, None, None))

# Invoke the model.
if len(inputs) == 1:
if isinstance(inputs, list) and len(inputs) == 1:
inputs = inputs[0]
output_values = self.model(inputs)
if isinstance(output_values, torch.Tensor):
Expand Down

0 comments on commit 1bfb1cc

Please sign in to comment.