Skip to content

Commit 56b073c

Browse files
committed
Fixing linter issues
1 parent e7ec901 commit 56b073c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tutorials/popular/blitz/autograd/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main() {
88
std::cout << "Autograd: Automatic Differentiation\n\n";
99

1010
std::cout << "Tensor\n\n";
11-
11+
1212
// Create a tensor and set requires_grad=True to track computation with it:
1313
auto x = torch::ones({2, 2}, torch::TensorOptions().requires_grad(true));
1414
std::cout << "x:\n" << x << '\n';
@@ -38,7 +38,7 @@ int main() {
3838

3939
// Let’s backprop now:
4040
out.backward();
41-
41+
4242
// Print gradients d(out)/dx:
4343
std::cout << "x.grad:\n" << x.grad() << '\n';
4444

tutorials/popular/blitz/tensors/main.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ int main() {
88
std::cout << "What is PyTorch?\n\n";
99

1010
std::cout << "Tensors\n\n";
11-
11+
1212
// Construct a 5x3 matrix, uninitialized:
1313
auto x = torch::empty({5, 3});
1414
std::cout << "x:\n" << x << '\n';
15-
15+
1616
// Construct a randomly initialized matrix:
1717
x = torch::rand({5, 3});
1818
std::cout << "x:\n" << x << '\n';
@@ -57,9 +57,9 @@ int main() {
5757
// Resizing: If you want to resize/reshape tensor, you can use torch::view:
5858
x = torch::randn({4, 4});
5959
y = x.view(16);
60-
auto z = x.view({-1, 8}); // the size -1 is inferred from other dimensions
60+
auto z = x.view({-1, 8}); // the size -1 is inferred from other dimensions
6161
std::cout << x.element_size() << y.element_size() << z.element_size() << '\n';
62-
62+
6363
// If you have a one element tensor, use .item() to get the value as a Python number
6464
x = torch::randn(1);
6565
std::cout << "x:\n" << x << '\n';

0 commit comments

Comments
 (0)