def get_dest_states(self) -> torch.Tensor: '''Get (and compute if necessary) cached property self.dest_states. For use by internal k2 code, relates to best-path.''' if hasattr(self, 'dest_states') is False: dest_states = _k2._get_dest_states(self.arcs, as_idx01=True) self._update_cache('dest_states', dest_states) return self.dest_states
def get_dest_states(self) -> torch.Tensor: '''Get (and compute if necessary) cached property self.dest_states. For use by internal k2 code, relates to best-path.''' name, cache = 'dest_states', self._cache if name not in cache: cache[name] = _k2._get_dest_states(self.arcs, as_idx01=True) return cache[name]
def update_dest_states(self) -> torch.Tensor: if hasattr(self, 'dest_states') is False: dest_states = _k2._get_dest_states(self.arcs, as_idx01=True) self._update_cache('dest_states', dest_states) return self.dest_states