Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion tests/ignite/contrib/handlers/test_trains_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,10 @@ def update_fn(engine, batch):
x = torch.rand((4, 2)).to(device)
optim.zero_grad()
y = model(x)
loss = y.pow(2.0).sum()
# Below code raises: RuntimeError: torch_xla/csrc/tensor_impl.cpp:144 : XLA tensors do not have storage
# Probably related to https://github.com/pytorch/xla/issues/2576
# loss = y.pow(2.0).sum()
loss = y.sum()
loss.backward()
if idist.has_xla_support:
import torch_xla.core.xla_model as xm
Expand Down
6 changes: 5 additions & 1 deletion tests/ignite/handlers/test_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,11 @@ def update_fn(engine, batch):
x = torch.rand((4, 1)).to(device)
optim.zero_grad()
y = model(x)
loss = y.pow(2.0).sum()
# Below code raises: RuntimeError: torch_xla/csrc/tensor_impl.cpp:144 : XLA tensors do not have storage
# Probably related to https://github.com/pytorch/xla/issues/2576
# loss = y.pow(2.0).sum()
loss = y.sum()
print(loss.device, y.device, x.device)
loss.backward()
if idist.has_xla_support:
import torch_xla.core.xla_model as xm
Expand Down