From 038b72ce05a103c3ea4a26edd91087455a5dd33c Mon Sep 17 00:00:00 2001 From: albanD Date: Tue, 27 Oct 2020 13:07:01 -0400 Subject: [PATCH 1/3] Update graph_mode_static_quantization_tutorial.py --- prototype_source/graph_mode_static_quantization_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prototype_source/graph_mode_static_quantization_tutorial.py b/prototype_source/graph_mode_static_quantization_tutorial.py index af649a15f02..64aa81138c6 100644 --- a/prototype_source/graph_mode_static_quantization_tutorial.py +++ b/prototype_source/graph_mode_static_quantization_tutorial.py @@ -137,7 +137,7 @@ def accuracy(output, target, topk=(1,)): res = [] for k in topk: - correct_k = correct[:k].view(-1).float().sum(0, keepdim=True) + correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True) res.append(correct_k.mul_(100.0 / batch_size)) return res From f7a79f8dda0341e42968b000d3f38f0ffa0c52d7 Mon Sep 17 00:00:00 2001 From: albanD Date: Tue, 27 Oct 2020 13:09:50 -0400 Subject: [PATCH 2/3] Update transformer_tutorial.py --- beginner_source/transformer_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/transformer_tutorial.py b/beginner_source/transformer_tutorial.py index aab564391e5..70bc9ccdb29 100644 --- a/beginner_source/transformer_tutorial.py +++ b/beginner_source/transformer_tutorial.py @@ -194,7 +194,7 @@ def batchify(data, bsz): def get_batch(source, i): seq_len = min(bptt, len(source) - 1 - i) data = source[i:i+seq_len] - target = source[i+1:i+1+seq_len].view(-1) + target = source[i+1:i+1+seq_len].reshape(-1) return data, target From eeff86585bcc14f7e64c14fd2dbd3ce88fba0e46 Mon Sep 17 00:00:00 2001 From: albanD Date: Tue, 27 Oct 2020 13:10:30 -0400 Subject: [PATCH 3/3] Update dynamic_quantization_tutorial.py --- advanced_source/dynamic_quantization_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced_source/dynamic_quantization_tutorial.py b/advanced_source/dynamic_quantization_tutorial.py index cabdd90d224..cfdacaca329 100644 --- a/advanced_source/dynamic_quantization_tutorial.py +++ b/advanced_source/dynamic_quantization_tutorial.py @@ -213,7 +213,7 @@ def batchify(data, bsz): def get_batch(source, i): seq_len = min(bptt, len(source) - 1 - i) data = source[i:i+seq_len] - target = source[i+1:i+1+seq_len].view(-1) + target = source[i+1:i+1+seq_len].reshape(-1) return data, target def repackage_hidden(h):