INNER CODE UNIT · Python
forward
lucidrains/vector-quantize-pytorch · vector_quantize_pytorch/binary_mapper.py:124
def forward(
self,
logits,
temperature = 1.,
straight_through = None,
calc_aux_loss = None,
deterministic = None,
return_indices = False,
reduce_aux_kl_loss = True
):
deterministic = default(deterministic, self.deterministic_on_eval and not self.training)
straight_through = default(straight_through, self.training)
calc_aux_loss = default(calc_aux_loss, self.training)
assert logits.shape[-1] == self.bits, f'logits must have a last dimension of {self.bits}'
orig_logits = logits