physai 2.5.2__tar.gz → 2.5.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: physai
3
- Version: 2.5.2
3
+ Version: 2.5.7
4
4
  Summary: Physics-Informed Neural Network (PINN) library for solving and animating ODEs/PDEs with visualization and training tools
5
5
  Author-email: Mankrit Singh <whataninfinity@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "physai"
7
- version = "2.5.2"
7
+ version = "2.5.7"
8
8
  description = "Physics-Informed Neural Network (PINN) library for solving and animating ODEs/PDEs with visualization and training tools"
9
9
  authors = [{name = "Mankrit Singh", email = "whataninfinity@gmail.com"}]
10
10
  readme = "README.md"
@@ -4,7 +4,11 @@ import torch.optim as optim
4
4
  from torch.amp import autocast
5
5
  from torch.amp import grad_scaler as GradScaler
6
6
  import warnings
7
- warnings.filterwarnings('ignore', category=torch.exceptions.ComplexHalfWarning)
7
+ try:
8
+ warnings.filterwarnings('ignore', category=torch.exceptions.ComplexHalfWarning)
9
+ except AttributeError:
10
+ # Ignore if the warning class doesn't exist (older PyTorch)
11
+ pass
8
12
 
9
13
  class PINN(nn.Module):
10
14
  """Physics-Informed Neural Network (PINN) with advanced optimization features."""
@@ -53,7 +57,9 @@ class PINN(nn.Module):
53
57
  imag = output[..., 1]
54
58
  else:
55
59
  raise ValueError(f"Expected output shape with last dim 2 for complex, got {output.shape}")
56
- return torch.complex(real, imag, dtype=torch.complex64)
60
+ complex_output = torch.complex(real, imag) # PyTorch infers dtype from inputs
61
+ complex_output = complex_output.to(torch.complex64) # optional, ensure 32-bit
62
+ return complex_output
57
63
  return output
58
64
 
59
65
  def physics_loss(self, x, physics_fn):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: physai
3
- Version: 2.5.2
3
+ Version: 2.5.7
4
4
  Summary: Physics-Informed Neural Network (PINN) library for solving and animating ODEs/PDEs with visualization and training tools
5
5
  Author-email: Mankrit Singh <whataninfinity@gmail.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes