mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Fix unused Python variables outside torch/ and test/ (#136359)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136359 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
241bf047b3
commit
498a7808ff
@ -62,7 +62,6 @@ class DelayedMulTensor(_Tensor):
|
||||
|
||||
plhs, levelslhs = self._lhs._tensor, self._lhs._levels
|
||||
prhs, levelsrhs = self._rhs._tensor, self._rhs._levels
|
||||
new_dims = tuple(d for d in self.dims if d not in dims)
|
||||
new_levels = [l for l in self._levels if l not in dims]
|
||||
fmt = "".join(
|
||||
[
|
||||
|
@ -198,7 +198,6 @@ def __torch_function__(self, orig, cls, args, kwargs=empty_dict):
|
||||
|
||||
if orig in pointwise:
|
||||
result_levels = llist()
|
||||
arg_levels = llist()
|
||||
to_expand = []
|
||||
for i, f in enumerate(flat_args):
|
||||
if isinstance(f, TensorLike):
|
||||
@ -268,7 +267,6 @@ def positional(self, *dims):
|
||||
needs_view = True
|
||||
|
||||
permute = list(range(len(levels)))
|
||||
nflat = len(flat_dims)
|
||||
for i, d in enumerate(flat_dims):
|
||||
try:
|
||||
idx = levels.index(d)
|
||||
|
@ -214,10 +214,6 @@ def main():
|
||||
else:
|
||||
generator = None
|
||||
|
||||
augmentations = [
|
||||
transforms.RandomCrop(32, padding=4),
|
||||
transforms.RandomHorizontalFlip(),
|
||||
]
|
||||
normalize = [
|
||||
transforms.ToTensor(),
|
||||
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
|
||||
|
@ -145,8 +145,6 @@ def loss_for_task(net, n_inner_iter, x_spt, y_spt, x_qry, y_qry):
|
||||
|
||||
|
||||
def train(db, net, device, meta_opt, epoch, log):
|
||||
params = dict(net.named_parameters())
|
||||
buffers = dict(net.named_buffers())
|
||||
n_train_iter = db.x_train.shape[0] // db.batchsz
|
||||
|
||||
for batch_idx in range(n_train_iter):
|
||||
|
Reference in New Issue
Block a user