Commit ff16d32
refactor: remove redundant Tensor allocation in GaussianConditional.update()
In GaussianConditional.update(), a temporary Tensor is allocated:
quantized_cdf = torch.Tensor(len(pmf_length), max_length + 2)
quantized_cdf = self._pmf_to_cdf(pmf, tail_mass, pmf_length, max_length)
The first line is a dead store: the variable is immediately overwritten by
the result of _pmf_to_cdf(). This removes the unnecessary allocation.
- No functional changes
- Slightly reduces heap traffic and avoids creating an uninitialized Tensor
- Keeps dtype/device fully defined by _pmf_to_cdf()1 parent 316a300 commit ff16d32
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | | - | |
681 | 680 | | |
682 | 681 | | |
683 | 682 | | |
| |||
0 commit comments