mirror of
https://github.com/storytold/torchscript-models.git
synced 2026-10-19 07:42:59 +00:00
more solutions
This commit is contained in:
@@ -78,7 +78,22 @@ Fix,
|
|||||||
<--- HERE
|
<--- HERE
|
||||||
```
|
```
|
||||||
|
|
||||||
Unroll the double list comprehension.
|
The above code is flattening a list of lists,
|
||||||
|
|
||||||
|
```
|
||||||
|
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
|
||||||
|
> >>> pad_shape = [item for sublist in l for item in sublist]
|
||||||
|
> >>> pad_shape
|
||||||
|
[1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
```
|
||||||
|
|
||||||
|
Unroll the double list comprehension. In this particular case, `torch.flatten()` [may work](https://stackoverflow.com/questions/55546873/how-do-i-flatten-a-tensor-in-pytorch/55546907),
|
||||||
|
|
||||||
|
```python
|
||||||
|
pad_shape = l.flatten()
|
||||||
|
```
|
||||||
|
|
||||||
|
*Note: I'm not certain this is correct yet.*
|
||||||
|
|
||||||
|
|
||||||
Model-specific details
|
Model-specific details
|
||||||
|
|||||||
Submodule glow-tts-jaywalnut/glow-tts updated: 00a482d06e...c88c81c1fe
Reference in New Issue
Block a user