Skip to content

Commit

Permalink
Wrap outs.to_dense() inside if layout=_mkldnn
Browse files Browse the repository at this point in the history
  • Loading branch information
vatai committed May 11, 2021
1 parent c012795 commit 05d1611
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion benchmarker/kernels/helpers_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def __call__(self, x, t):
# it?
if isinstance(outs, OrderedDict):
outs = outs["out"]
outs = outs.to_dense()
if outs.layout == torch._mkldnn:
outs = outs.to_dense()
loss = self.criterion(outs, t)
return loss

Expand Down

0 comments on commit 05d1611

Please sign in to comment.