Skip to content

Commit

Permalink
refactor variable initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
fancaiyu committed Feb 12, 2025
1 parent 54601f5 commit ac8dc61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: CI
on:
push:
branches:
- master
- test
pull_request:
branches:
- master
- test

permissions:
contents: write
Expand Down
10 changes: 5 additions & 5 deletions MCintegration/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ def __init__(self, batch_size, dim, f_dim, device=None, dtype=torch.float32):
self.dim = dim
self.f_dim = f_dim
self.batch_size = batch_size
self.u = torch.empty((batch_size, dim), dtype=dtype, device=self.device)
self.x = torch.empty((batch_size, dim), dtype=dtype, device=self.device)
self.fx = torch.empty((batch_size, f_dim), dtype=dtype, device=self.device)
self.weight = torch.empty((batch_size,), dtype=dtype, device=self.device)
self.detJ = torch.empty((batch_size,), dtype=dtype, device=self.device)
self.u = torch.rand((batch_size, dim), dtype=dtype, device=self.device)
self.x = torch.rand((batch_size, dim), dtype=dtype, device=self.device)
self.fx = torch.zeros((batch_size, f_dim), dtype=dtype, device=self.device)
self.weight = torch.ones((batch_size,), dtype=dtype, device=self.device)
self.detJ = torch.ones((batch_size,), dtype=dtype, device=self.device)


class Map(nn.Module):
Expand Down

0 comments on commit ac8dc61

Please sign in to comment.