Skip to content

Commit

Permalink
Fix broken _assert_no_grad import
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Richardson committed Jun 28, 2018
1 parent d6f192c commit 90fc14f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pytorch_binding/warpctc_pytorch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
import warpctc_pytorch as warp_ctc
from torch.autograd import Function
from torch.nn import Module
from torch.nn.modules.loss import _assert_no_grad

from ._warp_ctc import *


def _assert_no_grad(tensor):
assert not tensor.requires_grad, \
"gradients only computed for acts - please " \
"mark other tensors as not requiring gradients"


class _CTC(Function):
@staticmethod
def forward(ctx, acts, labels, act_lens, label_lens, size_average=False,
Expand Down

0 comments on commit 90fc14f

Please sign in to comment.