To fix the error to support batch_first=False.
if is_packed: x, batch_sizes = x max_batch_size = int(batch_sizes[0]) else: batch_sizes = None max_batch_size = x.size(0)
=======>
if is_packed: x, batch_sizes = x if self.batch_first: max_batch_size = int(batch_sizes[0]) else: max_batch_size = int(batch_sizes[1]) else: batch_sizes = None if self.batch_first: max_batch_size = x.size(0) else: max_batch_size = x.size(1)
To fix the error to support batch_first=False.
if is_packed: x, batch_sizes = x max_batch_size = int(batch_sizes[0]) else: batch_sizes = None max_batch_size = x.size(0)
=======>
if is_packed: x, batch_sizes = x if self.batch_first: max_batch_size = int(batch_sizes[0]) else: max_batch_size = int(batch_sizes[1]) else: batch_sizes = None if self.batch_first: max_batch_size = x.size(0) else: max_batch_size = x.size(1)