MCPcopy Create free account
hub / github.com/FLC777/GLAT / get_normalized_probs

Method get_normalized_probs

fairseq/models/fairseq_decoder.py:60–67  ·  view source on GitHub ↗

Get normalized probabilities (or log probs) from a net's output.

(
        self,
        net_output: Tuple[Tensor, Optional[Dict[str, List[Optional[Tensor]]]]],
        log_probs: bool,
        sample: Optional[Dict[str, Tensor]] = None,
    )

Source from the content-addressed store, hash-verified

58 raise NotImplementedError
59
60 def get_normalized_probs(
61 self,
62 net_output: Tuple[Tensor, Optional[Dict[str, List[Optional[Tensor]]]]],
63 log_probs: bool,
64 sample: Optional[Dict[str, Tensor]] = None,
65 ):
66 """Get normalized probabilities (or log probs) from a net's output."""
67 return self.get_normalized_probs_scriptable(net_output, log_probs, sample)
68
69 # TorchScript doesn't support super() method so that the scriptable Subclass
70 # can't access the base class model in Torchscript.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected