Skip to content

Commit ac8dc61

Browse files
committed
refactor variable initialization
1 parent 54601f5 commit ac8dc61

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- test
77
pull_request:
88
branches:
9-
- master
9+
- test
1010

1111
permissions:
1212
contents: write

MCintegration/maps.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def __init__(self, batch_size, dim, f_dim, device=None, dtype=torch.float32):
1717
self.dim = dim
1818
self.f_dim = f_dim
1919
self.batch_size = batch_size
20-
self.u = torch.empty((batch_size, dim), dtype=dtype, device=self.device)
21-
self.x = torch.empty((batch_size, dim), dtype=dtype, device=self.device)
22-
self.fx = torch.empty((batch_size, f_dim), dtype=dtype, device=self.device)
23-
self.weight = torch.empty((batch_size,), dtype=dtype, device=self.device)
24-
self.detJ = torch.empty((batch_size,), dtype=dtype, device=self.device)
20+
self.u = torch.rand((batch_size, dim), dtype=dtype, device=self.device)
21+
self.x = torch.rand((batch_size, dim), dtype=dtype, device=self.device)
22+
self.fx = torch.zeros((batch_size, f_dim), dtype=dtype, device=self.device)
23+
self.weight = torch.ones((batch_size,), dtype=dtype, device=self.device)
24+
self.detJ = torch.ones((batch_size,), dtype=dtype, device=self.device)
2525

2626

2727
class Map(nn.Module):

0 commit comments

Comments
 (0)