pytorch.nn.functional.pad
by Jerry Su, post on May 02, 2022Reason is the light and the light of life.
Creating folds properly
by Jerry Su, post on Feb 27, 2022Reason is the light and the light of life.
Mapping chars and words to tokens
by Jerry Su, post on Feb 22, 2022Reason is the light and the light of life.
Feedback prize evaluating student writing
by Jerry Su, post on Feb 18, 2022Reason is the light and the light of life.
Numpy [None, …]
by Jerry Su, post on Nov 26, 2021None
在对应位置增加一个维度(类似于unsqueeze(axis=)
)
...
等价于[:,:,:]
import numpy as np
arr = np.random.randn(5, 10)
arr.shape
(5, 10)
arr[None, ...].shape
(1, 5, 10)
arr[..., None].shape
(5, 10, 1)
arr[:, None, :].shape
(5 …