kiwi.data.batch

Module Contents

Classes

BatchedSentence

MultiFieldBatch

dict() -> new empty dictionary

Functions

tensors_to(tensors, *args, **kwargs)

class kiwi.data.batch.BatchedSentence
tensor :torch.Tensor
lengths :torch.Tensor
bounds :torch.Tensor
bounds_lengths :torch.Tensor
strict_masks :torch.Tensor
number_of_tokens :torch.Tensor
pin_memory(self)
to(self, *args, **kwargs)
class kiwi.data.batch.MultiFieldBatch(batch: dict)

Bases: dict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

pin_memory(self)
to(self, *args, **kwargs)
kiwi.data.batch.tensors_to(tensors, *args, **kwargs)