featomic-torch 0.6.2__py3-none-win_amd64.whl → 0.7.1__py3-none-win_amd64.whl

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.
Files changed (78) hide show
  1. featomic/torch/_build_versions.py +1 -1
  2. featomic/torch/_c_lib.py +4 -2
  3. featomic/torch/calculator_base.py +1 -3
  4. featomic/torch/system.py +4 -4
  5. featomic/torch/torch-2.1/bin/featomic_torch.dll +0 -0
  6. featomic/torch/torch-2.1/include/featomic/torch/autograd.hpp +1 -1
  7. featomic/torch/torch-2.1/include/featomic/torch/calculator.hpp +11 -11
  8. featomic/torch/torch-2.1/include/featomic/torch/system.hpp +5 -5
  9. featomic/torch/torch-2.1/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +3 -3
  10. featomic/torch/torch-2.1/lib/cmake/featomic_torch/featomic_torch-config.cmake +5 -1
  11. featomic/torch/torch-2.1/lib/cmake/featomic_torch/featomic_torch-targets.cmake +2 -2
  12. featomic/torch/torch-2.1/lib/featomic_torch.lib +0 -0
  13. featomic/torch/torch-2.2/bin/featomic_torch.dll +0 -0
  14. featomic/torch/torch-2.2/include/featomic/torch/autograd.hpp +1 -1
  15. featomic/torch/torch-2.2/include/featomic/torch/calculator.hpp +11 -11
  16. featomic/torch/torch-2.2/include/featomic/torch/system.hpp +5 -5
  17. featomic/torch/torch-2.2/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +3 -3
  18. featomic/torch/torch-2.2/lib/cmake/featomic_torch/featomic_torch-config.cmake +5 -1
  19. featomic/torch/torch-2.2/lib/cmake/featomic_torch/featomic_torch-targets.cmake +2 -2
  20. featomic/torch/torch-2.2/lib/featomic_torch.lib +0 -0
  21. featomic/torch/torch-2.3/bin/featomic_torch.dll +0 -0
  22. featomic/torch/torch-2.3/include/featomic/torch/autograd.hpp +1 -1
  23. featomic/torch/torch-2.3/include/featomic/torch/calculator.hpp +11 -11
  24. featomic/torch/torch-2.3/include/featomic/torch/system.hpp +5 -5
  25. featomic/torch/torch-2.3/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +3 -3
  26. featomic/torch/torch-2.3/lib/cmake/featomic_torch/featomic_torch-config.cmake +5 -1
  27. featomic/torch/torch-2.3/lib/cmake/featomic_torch/featomic_torch-targets.cmake +2 -2
  28. featomic/torch/torch-2.3/lib/featomic_torch.lib +0 -0
  29. featomic/torch/torch-2.4/bin/featomic_torch.dll +0 -0
  30. featomic/torch/torch-2.4/include/featomic/torch/autograd.hpp +1 -1
  31. featomic/torch/torch-2.4/include/featomic/torch/calculator.hpp +11 -11
  32. featomic/torch/torch-2.4/include/featomic/torch/system.hpp +5 -5
  33. featomic/torch/torch-2.4/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +3 -3
  34. featomic/torch/torch-2.4/lib/cmake/featomic_torch/featomic_torch-config.cmake +5 -1
  35. featomic/torch/torch-2.4/lib/cmake/featomic_torch/featomic_torch-targets.cmake +2 -2
  36. featomic/torch/torch-2.4/lib/featomic_torch.lib +0 -0
  37. featomic/torch/torch-2.5/bin/featomic_torch.dll +0 -0
  38. featomic/torch/torch-2.5/include/featomic/torch/autograd.hpp +1 -1
  39. featomic/torch/torch-2.5/include/featomic/torch/calculator.hpp +11 -11
  40. featomic/torch/torch-2.5/include/featomic/torch/system.hpp +5 -5
  41. featomic/torch/torch-2.5/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +3 -3
  42. featomic/torch/torch-2.5/lib/cmake/featomic_torch/featomic_torch-config.cmake +5 -1
  43. featomic/torch/torch-2.5/lib/cmake/featomic_torch/featomic_torch-targets.cmake +2 -2
  44. featomic/torch/torch-2.5/lib/featomic_torch.lib +0 -0
  45. featomic/torch/torch-2.6/bin/featomic_torch.dll +0 -0
  46. featomic/torch/torch-2.6/include/featomic/torch/autograd.hpp +1 -1
  47. featomic/torch/torch-2.6/include/featomic/torch/calculator.hpp +11 -11
  48. featomic/torch/torch-2.6/include/featomic/torch/system.hpp +5 -5
  49. featomic/torch/torch-2.6/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +3 -3
  50. featomic/torch/torch-2.6/lib/cmake/featomic_torch/featomic_torch-config.cmake +5 -1
  51. featomic/torch/torch-2.6/lib/cmake/featomic_torch/featomic_torch-targets.cmake +2 -2
  52. featomic/torch/torch-2.6/lib/featomic_torch.lib +0 -0
  53. featomic/torch/torch-2.7/bin/featomic_torch.dll +0 -0
  54. featomic/torch/torch-2.7/include/featomic/torch/autograd.hpp +1 -1
  55. featomic/torch/torch-2.7/include/featomic/torch/calculator.hpp +11 -11
  56. featomic/torch/torch-2.7/include/featomic/torch/system.hpp +5 -5
  57. featomic/torch/torch-2.7/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +3 -3
  58. featomic/torch/torch-2.7/lib/cmake/featomic_torch/featomic_torch-config.cmake +6 -2
  59. featomic/torch/torch-2.7/lib/cmake/featomic_torch/featomic_torch-targets.cmake +2 -2
  60. featomic/torch/torch-2.7/lib/featomic_torch.lib +0 -0
  61. featomic/torch/torch-2.8/bin/featomic_torch.dll +0 -0
  62. featomic/torch/torch-2.8/include/featomic/torch/autograd.hpp +58 -0
  63. featomic/torch/torch-2.8/include/featomic/torch/calculator.hpp +134 -0
  64. featomic/torch/torch-2.8/include/featomic/torch/exports.h +43 -0
  65. featomic/torch/torch-2.8/include/featomic/torch/system.hpp +112 -0
  66. featomic/torch/torch-2.8/include/featomic/torch.hpp +10 -0
  67. featomic/torch/torch-2.8/lib/cmake/featomic_torch/featomic_torch-config-version.cmake +85 -0
  68. featomic/torch/torch-2.8/lib/cmake/featomic_torch/featomic_torch-config.cmake +32 -0
  69. featomic/torch/torch-2.8/lib/cmake/featomic_torch/featomic_torch-targets-release.cmake +19 -0
  70. featomic/torch/torch-2.8/lib/cmake/featomic_torch/featomic_torch-targets.cmake +108 -0
  71. featomic/torch/torch-2.8/lib/featomic_torch.lib +0 -0
  72. {featomic_torch-0.6.2.dist-info → featomic_torch-0.7.1.dist-info}/METADATA +5 -4
  73. featomic_torch-0.7.1.dist-info/RECORD +102 -0
  74. {featomic_torch-0.6.2.dist-info → featomic_torch-0.7.1.dist-info}/WHEEL +1 -1
  75. featomic_torch-0.6.2.dist-info/RECORD +0 -91
  76. {featomic_torch-0.6.2.dist-info → featomic_torch-0.7.1.dist-info}/licenses/AUTHORS +0 -0
  77. {featomic_torch-0.6.2.dist-info → featomic_torch-0.7.1.dist-info}/licenses/LICENSE +0 -0
  78. {featomic_torch-0.6.2.dist-info → featomic_torch-0.7.1.dist-info}/top_level.txt +0 -0
@@ -2,4 +2,4 @@
2
2
 
3
3
 
4
4
  # version of featomic used when compiling this package
5
- BUILD_FEATOMIC_VERSION = '0.6.1'
5
+ BUILD_FEATOMIC_VERSION = '0.6.2'
featomic/torch/_c_lib.py CHANGED
@@ -5,6 +5,7 @@ import sys
5
5
  from collections import namedtuple
6
6
 
7
7
  import metatensor.torch
8
+ import metatomic.torch
8
9
  import torch
9
10
 
10
11
  import featomic
@@ -128,9 +129,10 @@ def _check_dll(path):
128
129
 
129
130
 
130
131
  def _load_library():
131
- # Load featomic & metatensor-torch shared library in the process first, to ensure
132
- # the featomic_torch shared library can find them
132
+ # Load shared library for dependencies in the process first, to ensure the
133
+ # featomic_torch shared library can find them
133
134
  metatensor.torch._c_lib._load_library()
135
+ metatomic.torch._c_lib._load_library()
134
136
 
135
137
  featomic._c_lib._get_library()
136
138
 
@@ -2,9 +2,7 @@ from typing import List, Optional, Union
2
2
 
3
3
  import torch
4
4
  from metatensor.torch import Labels, TensorMap
5
- from metatensor.torch.atomistic import NeighborListOptions
6
-
7
- from .system import System
5
+ from metatomic.torch import NeighborListOptions, System
8
6
 
9
7
 
10
8
  CalculatorHolder = torch.classes.featomic.CalculatorHolder
featomic/torch/system.py CHANGED
@@ -2,7 +2,7 @@ from typing import List, Optional, Sequence, overload
2
2
 
3
3
  import numpy as np
4
4
  import torch
5
- from metatensor.torch.atomistic import System
5
+ from metatomic.torch import System
6
6
 
7
7
  import featomic
8
8
 
@@ -31,9 +31,9 @@ def systems_to_torch(
31
31
  cell_requires_grad=None,
32
32
  ) -> List[System]:
33
33
  """
34
- Convert a arbitrary system to metatensor's atomistic
35
- :py:class:`metatensor.torch.atomistic.System`, putting all the data in
36
- :py:class:`torch.Tensor` and making the overall object compatible with TorchScript.
34
+ Convert a arbitrary system to :py:class:`metatomic.torch.System`, putting all the
35
+ data in :py:class:`torch.Tensor` and making the overall object compatible with
36
+ TorchScript.
37
37
 
38
38
  :param system: any system supported by featomic. If this is an iterable of system,
39
39
  this function converts them all and returns a list of converted systems.
@@ -41,7 +41,7 @@ public:
41
41
  torch::Tensor all_positions,
42
42
  torch::Tensor all_cells,
43
43
  torch::IValue systems_start,
44
- metatensor_torch::TorchTensorBlock block
44
+ metatensor_torch::TensorBlock block
45
45
  );
46
46
 
47
47
  /// Backward step: get the gradients of some quantity `A` w.r.t. the outputs
@@ -5,7 +5,7 @@
5
5
 
6
6
  #include <featomic.hpp>
7
7
  #include <metatensor/torch.hpp>
8
- #include <metatensor/torch/atomistic.hpp>
8
+ #include <metatomic/torch.hpp>
9
9
 
10
10
  #include "featomic/torch/exports.h"
11
11
 
@@ -61,12 +61,12 @@ public:
61
61
  void set_selected_keys(torch::IValue selection);
62
62
 
63
63
  /// which gradients to keep in the output of a calculation
64
- std::vector<std::string> gradients = {};
64
+ std::vector<std::string> gradients;
65
65
 
66
66
  private:
67
- torch::IValue selected_samples_ = torch::IValue();
68
- torch::IValue selected_properties_ = torch::IValue();
69
- torch::IValue selected_keys_ = torch::IValue();
67
+ torch::IValue selected_samples_;
68
+ torch::IValue selected_properties_;
69
+ torch::IValue selected_keys_;
70
70
  };
71
71
 
72
72
  /// Custom class holder to store, serialize and load featomic calculators
@@ -99,9 +99,9 @@ public:
99
99
  return calculator_.cutoffs();
100
100
  }
101
101
 
102
- /// Run a calculation for the given `systems` using the given options
103
- metatensor_torch::TorchTensorMap compute(
104
- std::vector<metatensor_torch::System> systems,
102
+ /// Run a calculation for the given `systems` using the given options.
103
+ metatensor_torch::TensorMap compute(
104
+ std::vector<metatomic_torch::System> systems,
105
105
  TorchCalculatorOptions options = {}
106
106
  );
107
107
 
@@ -123,9 +123,9 @@ private:
123
123
  /// contain `"cell"` gradients.
124
124
  ///
125
125
  /// `forward_gradients` controls which gradients are left inside the TensorMap.
126
- metatensor_torch::TorchTensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
- std::vector<metatensor_torch::System> systems,
128
- metatensor_torch::TorchTensorMap precomputed,
126
+ metatensor_torch::TensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
+ std::vector<metatomic_torch::System> systems,
128
+ metatensor_torch::TensorMap precomputed,
129
129
  std::vector<std::string> forward_gradients
130
130
  );
131
131
 
@@ -7,21 +7,21 @@
7
7
  #include <torch/script.h>
8
8
 
9
9
  #include <featomic.hpp>
10
- #include <metatensor/torch/atomistic.hpp>
10
+ #include <metatomic/torch.hpp>
11
11
 
12
12
  #include "featomic/torch/exports.h"
13
13
 
14
14
  namespace featomic_torch {
15
15
 
16
- /// Implementation of `featomic::System` using `metatensor_torch::System` as
16
+ /// Implementation of `featomic::System` using `metatomic_torch::System` as
17
17
  /// backing memory for all the data.
18
18
  ///
19
19
  /// This can either be used with the Rust neighbor list implementation; or a set
20
20
  /// of pre-computed neighbor lists can be added to the system.
21
21
  class FEATOMIC_TORCH_EXPORT SystemAdapter final: public featomic::System {
22
22
  public:
23
- /// Create a `SystemAdapter` wrapping an existing `metatensor_torch::System`
24
- SystemAdapter(metatensor_torch::System system);
23
+ /// Create a `SystemAdapter` wrapping an existing `metatomic_torch::System`
24
+ SystemAdapter(metatomic_torch::System system);
25
25
 
26
26
  ~SystemAdapter() override = default;
27
27
 
@@ -84,7 +84,7 @@ public:
84
84
 
85
85
  private:
86
86
  // the origin of all the data
87
- metatensor_torch::System system_;
87
+ metatomic_torch::System system_;
88
88
 
89
89
  /// atomic types tensor, contiguous and on CPU
90
90
  torch::Tensor types_;
@@ -10,13 +10,13 @@
10
10
  # The variable CVF_VERSION must be set before calling configure_file().
11
11
 
12
12
 
13
- set(PACKAGE_VERSION "0.6.2")
13
+ set(PACKAGE_VERSION "0.7.1")
14
14
 
15
15
  if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
16
16
  set(PACKAGE_VERSION_COMPATIBLE FALSE)
17
17
  else()
18
18
 
19
- if("0.6.2" MATCHES "^([0-9]+)\\.([0-9]+)")
19
+ if("0.7.1" MATCHES "^([0-9]+)\\.([0-9]+)")
20
20
  set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
21
21
  set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
22
22
 
@@ -27,7 +27,7 @@ else()
27
27
  string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
28
28
  endif()
29
29
  else()
30
- set(CVF_VERSION_MAJOR "0.6.2")
30
+ set(CVF_VERSION_MAJOR "0.7.1")
31
31
  set(CVF_VERSION_MINOR "")
32
32
  endif()
33
33
 
@@ -5,9 +5,13 @@ set(REQUIRED_FEATOMIC_VERSION 0.6)
5
5
  find_package(featomic ${REQUIRED_FEATOMIC_VERSION} CONFIG REQUIRED)
6
6
 
7
7
  # use the same version for metatensor_torch as the main CMakeLists.txt
8
- set(REQUIRED_METATENSOR_TORCH_VERSION 0.7)
8
+ set(REQUIRED_METATENSOR_TORCH_VERSION 0.8.0)
9
9
  find_package(metatensor_torch ${REQUIRED_METATENSOR_TORCH_VERSION} CONFIG REQUIRED)
10
10
 
11
+ # use the same version for metatomic_torch as the main CMakeLists.txt
12
+ set(REQUIRED_METATOMIC_TORCH_VERSION 0.1)
13
+ find_package(metatomic_torch ${REQUIRED_METATOMIC_TORCH_VERSION} CONFIG REQUIRED)
14
+
11
15
  # We can only load metatensorfeatomic_torch with the same minor version of Torch
12
16
  # that was used to compile it (and is stored in BUILD_TORCH_VERSION)
13
17
  set(BUILD_TORCH_VERSION 2.1.2)
@@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "2.8.12")
7
7
  message(FATAL_ERROR "CMake >= 2.8.12 required")
8
8
  endif()
9
9
  cmake_policy(PUSH)
10
- cmake_policy(VERSION 2.8.12...3.30)
10
+ cmake_policy(VERSION 2.8.12...3.31)
11
11
  #----------------------------------------------------------------
12
12
  # Generated CMake target import file.
13
13
  #----------------------------------------------------------------
@@ -61,7 +61,7 @@ add_library(featomic_torch SHARED IMPORTED)
61
61
  set_target_properties(featomic_torch PROPERTIES
62
62
  INTERFACE_COMPILE_FEATURES "cxx_std_17"
63
63
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
64
- INTERFACE_LINK_LIBRARIES "torch;metatensor_torch;featomic::shared"
64
+ INTERFACE_LINK_LIBRARIES "torch;metatomic_torch;metatensor_torch;featomic::shared"
65
65
  )
66
66
 
67
67
  # Load information for each installed configuration.
@@ -41,7 +41,7 @@ public:
41
41
  torch::Tensor all_positions,
42
42
  torch::Tensor all_cells,
43
43
  torch::IValue systems_start,
44
- metatensor_torch::TorchTensorBlock block
44
+ metatensor_torch::TensorBlock block
45
45
  );
46
46
 
47
47
  /// Backward step: get the gradients of some quantity `A` w.r.t. the outputs
@@ -5,7 +5,7 @@
5
5
 
6
6
  #include <featomic.hpp>
7
7
  #include <metatensor/torch.hpp>
8
- #include <metatensor/torch/atomistic.hpp>
8
+ #include <metatomic/torch.hpp>
9
9
 
10
10
  #include "featomic/torch/exports.h"
11
11
 
@@ -61,12 +61,12 @@ public:
61
61
  void set_selected_keys(torch::IValue selection);
62
62
 
63
63
  /// which gradients to keep in the output of a calculation
64
- std::vector<std::string> gradients = {};
64
+ std::vector<std::string> gradients;
65
65
 
66
66
  private:
67
- torch::IValue selected_samples_ = torch::IValue();
68
- torch::IValue selected_properties_ = torch::IValue();
69
- torch::IValue selected_keys_ = torch::IValue();
67
+ torch::IValue selected_samples_;
68
+ torch::IValue selected_properties_;
69
+ torch::IValue selected_keys_;
70
70
  };
71
71
 
72
72
  /// Custom class holder to store, serialize and load featomic calculators
@@ -99,9 +99,9 @@ public:
99
99
  return calculator_.cutoffs();
100
100
  }
101
101
 
102
- /// Run a calculation for the given `systems` using the given options
103
- metatensor_torch::TorchTensorMap compute(
104
- std::vector<metatensor_torch::System> systems,
102
+ /// Run a calculation for the given `systems` using the given options.
103
+ metatensor_torch::TensorMap compute(
104
+ std::vector<metatomic_torch::System> systems,
105
105
  TorchCalculatorOptions options = {}
106
106
  );
107
107
 
@@ -123,9 +123,9 @@ private:
123
123
  /// contain `"cell"` gradients.
124
124
  ///
125
125
  /// `forward_gradients` controls which gradients are left inside the TensorMap.
126
- metatensor_torch::TorchTensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
- std::vector<metatensor_torch::System> systems,
128
- metatensor_torch::TorchTensorMap precomputed,
126
+ metatensor_torch::TensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
+ std::vector<metatomic_torch::System> systems,
128
+ metatensor_torch::TensorMap precomputed,
129
129
  std::vector<std::string> forward_gradients
130
130
  );
131
131
 
@@ -7,21 +7,21 @@
7
7
  #include <torch/script.h>
8
8
 
9
9
  #include <featomic.hpp>
10
- #include <metatensor/torch/atomistic.hpp>
10
+ #include <metatomic/torch.hpp>
11
11
 
12
12
  #include "featomic/torch/exports.h"
13
13
 
14
14
  namespace featomic_torch {
15
15
 
16
- /// Implementation of `featomic::System` using `metatensor_torch::System` as
16
+ /// Implementation of `featomic::System` using `metatomic_torch::System` as
17
17
  /// backing memory for all the data.
18
18
  ///
19
19
  /// This can either be used with the Rust neighbor list implementation; or a set
20
20
  /// of pre-computed neighbor lists can be added to the system.
21
21
  class FEATOMIC_TORCH_EXPORT SystemAdapter final: public featomic::System {
22
22
  public:
23
- /// Create a `SystemAdapter` wrapping an existing `metatensor_torch::System`
24
- SystemAdapter(metatensor_torch::System system);
23
+ /// Create a `SystemAdapter` wrapping an existing `metatomic_torch::System`
24
+ SystemAdapter(metatomic_torch::System system);
25
25
 
26
26
  ~SystemAdapter() override = default;
27
27
 
@@ -84,7 +84,7 @@ public:
84
84
 
85
85
  private:
86
86
  // the origin of all the data
87
- metatensor_torch::System system_;
87
+ metatomic_torch::System system_;
88
88
 
89
89
  /// atomic types tensor, contiguous and on CPU
90
90
  torch::Tensor types_;
@@ -10,13 +10,13 @@
10
10
  # The variable CVF_VERSION must be set before calling configure_file().
11
11
 
12
12
 
13
- set(PACKAGE_VERSION "0.6.2")
13
+ set(PACKAGE_VERSION "0.7.1")
14
14
 
15
15
  if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
16
16
  set(PACKAGE_VERSION_COMPATIBLE FALSE)
17
17
  else()
18
18
 
19
- if("0.6.2" MATCHES "^([0-9]+)\\.([0-9]+)")
19
+ if("0.7.1" MATCHES "^([0-9]+)\\.([0-9]+)")
20
20
  set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
21
21
  set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
22
22
 
@@ -27,7 +27,7 @@ else()
27
27
  string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
28
28
  endif()
29
29
  else()
30
- set(CVF_VERSION_MAJOR "0.6.2")
30
+ set(CVF_VERSION_MAJOR "0.7.1")
31
31
  set(CVF_VERSION_MINOR "")
32
32
  endif()
33
33
 
@@ -5,9 +5,13 @@ set(REQUIRED_FEATOMIC_VERSION 0.6)
5
5
  find_package(featomic ${REQUIRED_FEATOMIC_VERSION} CONFIG REQUIRED)
6
6
 
7
7
  # use the same version for metatensor_torch as the main CMakeLists.txt
8
- set(REQUIRED_METATENSOR_TORCH_VERSION 0.7)
8
+ set(REQUIRED_METATENSOR_TORCH_VERSION 0.8.0)
9
9
  find_package(metatensor_torch ${REQUIRED_METATENSOR_TORCH_VERSION} CONFIG REQUIRED)
10
10
 
11
+ # use the same version for metatomic_torch as the main CMakeLists.txt
12
+ set(REQUIRED_METATOMIC_TORCH_VERSION 0.1)
13
+ find_package(metatomic_torch ${REQUIRED_METATOMIC_TORCH_VERSION} CONFIG REQUIRED)
14
+
11
15
  # We can only load metatensorfeatomic_torch with the same minor version of Torch
12
16
  # that was used to compile it (and is stored in BUILD_TORCH_VERSION)
13
17
  set(BUILD_TORCH_VERSION 2.2.2)
@@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "2.8.12")
7
7
  message(FATAL_ERROR "CMake >= 2.8.12 required")
8
8
  endif()
9
9
  cmake_policy(PUSH)
10
- cmake_policy(VERSION 2.8.12...3.30)
10
+ cmake_policy(VERSION 2.8.12...3.31)
11
11
  #----------------------------------------------------------------
12
12
  # Generated CMake target import file.
13
13
  #----------------------------------------------------------------
@@ -61,7 +61,7 @@ add_library(featomic_torch SHARED IMPORTED)
61
61
  set_target_properties(featomic_torch PROPERTIES
62
62
  INTERFACE_COMPILE_FEATURES "cxx_std_17"
63
63
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
64
- INTERFACE_LINK_LIBRARIES "torch;metatensor_torch;featomic::shared"
64
+ INTERFACE_LINK_LIBRARIES "torch;metatomic_torch;metatensor_torch;featomic::shared"
65
65
  )
66
66
 
67
67
  # Load information for each installed configuration.
@@ -41,7 +41,7 @@ public:
41
41
  torch::Tensor all_positions,
42
42
  torch::Tensor all_cells,
43
43
  torch::IValue systems_start,
44
- metatensor_torch::TorchTensorBlock block
44
+ metatensor_torch::TensorBlock block
45
45
  );
46
46
 
47
47
  /// Backward step: get the gradients of some quantity `A` w.r.t. the outputs
@@ -5,7 +5,7 @@
5
5
 
6
6
  #include <featomic.hpp>
7
7
  #include <metatensor/torch.hpp>
8
- #include <metatensor/torch/atomistic.hpp>
8
+ #include <metatomic/torch.hpp>
9
9
 
10
10
  #include "featomic/torch/exports.h"
11
11
 
@@ -61,12 +61,12 @@ public:
61
61
  void set_selected_keys(torch::IValue selection);
62
62
 
63
63
  /// which gradients to keep in the output of a calculation
64
- std::vector<std::string> gradients = {};
64
+ std::vector<std::string> gradients;
65
65
 
66
66
  private:
67
- torch::IValue selected_samples_ = torch::IValue();
68
- torch::IValue selected_properties_ = torch::IValue();
69
- torch::IValue selected_keys_ = torch::IValue();
67
+ torch::IValue selected_samples_;
68
+ torch::IValue selected_properties_;
69
+ torch::IValue selected_keys_;
70
70
  };
71
71
 
72
72
  /// Custom class holder to store, serialize and load featomic calculators
@@ -99,9 +99,9 @@ public:
99
99
  return calculator_.cutoffs();
100
100
  }
101
101
 
102
- /// Run a calculation for the given `systems` using the given options
103
- metatensor_torch::TorchTensorMap compute(
104
- std::vector<metatensor_torch::System> systems,
102
+ /// Run a calculation for the given `systems` using the given options.
103
+ metatensor_torch::TensorMap compute(
104
+ std::vector<metatomic_torch::System> systems,
105
105
  TorchCalculatorOptions options = {}
106
106
  );
107
107
 
@@ -123,9 +123,9 @@ private:
123
123
  /// contain `"cell"` gradients.
124
124
  ///
125
125
  /// `forward_gradients` controls which gradients are left inside the TensorMap.
126
- metatensor_torch::TorchTensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
- std::vector<metatensor_torch::System> systems,
128
- metatensor_torch::TorchTensorMap precomputed,
126
+ metatensor_torch::TensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
+ std::vector<metatomic_torch::System> systems,
128
+ metatensor_torch::TensorMap precomputed,
129
129
  std::vector<std::string> forward_gradients
130
130
  );
131
131
 
@@ -7,21 +7,21 @@
7
7
  #include <torch/script.h>
8
8
 
9
9
  #include <featomic.hpp>
10
- #include <metatensor/torch/atomistic.hpp>
10
+ #include <metatomic/torch.hpp>
11
11
 
12
12
  #include "featomic/torch/exports.h"
13
13
 
14
14
  namespace featomic_torch {
15
15
 
16
- /// Implementation of `featomic::System` using `metatensor_torch::System` as
16
+ /// Implementation of `featomic::System` using `metatomic_torch::System` as
17
17
  /// backing memory for all the data.
18
18
  ///
19
19
  /// This can either be used with the Rust neighbor list implementation; or a set
20
20
  /// of pre-computed neighbor lists can be added to the system.
21
21
  class FEATOMIC_TORCH_EXPORT SystemAdapter final: public featomic::System {
22
22
  public:
23
- /// Create a `SystemAdapter` wrapping an existing `metatensor_torch::System`
24
- SystemAdapter(metatensor_torch::System system);
23
+ /// Create a `SystemAdapter` wrapping an existing `metatomic_torch::System`
24
+ SystemAdapter(metatomic_torch::System system);
25
25
 
26
26
  ~SystemAdapter() override = default;
27
27
 
@@ -84,7 +84,7 @@ public:
84
84
 
85
85
  private:
86
86
  // the origin of all the data
87
- metatensor_torch::System system_;
87
+ metatomic_torch::System system_;
88
88
 
89
89
  /// atomic types tensor, contiguous and on CPU
90
90
  torch::Tensor types_;
@@ -10,13 +10,13 @@
10
10
  # The variable CVF_VERSION must be set before calling configure_file().
11
11
 
12
12
 
13
- set(PACKAGE_VERSION "0.6.2")
13
+ set(PACKAGE_VERSION "0.7.1")
14
14
 
15
15
  if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
16
16
  set(PACKAGE_VERSION_COMPATIBLE FALSE)
17
17
  else()
18
18
 
19
- if("0.6.2" MATCHES "^([0-9]+)\\.([0-9]+)")
19
+ if("0.7.1" MATCHES "^([0-9]+)\\.([0-9]+)")
20
20
  set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
21
21
  set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
22
22
 
@@ -27,7 +27,7 @@ else()
27
27
  string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
28
28
  endif()
29
29
  else()
30
- set(CVF_VERSION_MAJOR "0.6.2")
30
+ set(CVF_VERSION_MAJOR "0.7.1")
31
31
  set(CVF_VERSION_MINOR "")
32
32
  endif()
33
33
 
@@ -5,9 +5,13 @@ set(REQUIRED_FEATOMIC_VERSION 0.6)
5
5
  find_package(featomic ${REQUIRED_FEATOMIC_VERSION} CONFIG REQUIRED)
6
6
 
7
7
  # use the same version for metatensor_torch as the main CMakeLists.txt
8
- set(REQUIRED_METATENSOR_TORCH_VERSION 0.7)
8
+ set(REQUIRED_METATENSOR_TORCH_VERSION 0.8.0)
9
9
  find_package(metatensor_torch ${REQUIRED_METATENSOR_TORCH_VERSION} CONFIG REQUIRED)
10
10
 
11
+ # use the same version for metatomic_torch as the main CMakeLists.txt
12
+ set(REQUIRED_METATOMIC_TORCH_VERSION 0.1)
13
+ find_package(metatomic_torch ${REQUIRED_METATOMIC_TORCH_VERSION} CONFIG REQUIRED)
14
+
11
15
  # We can only load metatensorfeatomic_torch with the same minor version of Torch
12
16
  # that was used to compile it (and is stored in BUILD_TORCH_VERSION)
13
17
  set(BUILD_TORCH_VERSION 2.3.1)
@@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "2.8.12")
7
7
  message(FATAL_ERROR "CMake >= 2.8.12 required")
8
8
  endif()
9
9
  cmake_policy(PUSH)
10
- cmake_policy(VERSION 2.8.12...3.30)
10
+ cmake_policy(VERSION 2.8.12...3.31)
11
11
  #----------------------------------------------------------------
12
12
  # Generated CMake target import file.
13
13
  #----------------------------------------------------------------
@@ -61,7 +61,7 @@ add_library(featomic_torch SHARED IMPORTED)
61
61
  set_target_properties(featomic_torch PROPERTIES
62
62
  INTERFACE_COMPILE_FEATURES "cxx_std_17"
63
63
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
64
- INTERFACE_LINK_LIBRARIES "torch;metatensor_torch;featomic::shared"
64
+ INTERFACE_LINK_LIBRARIES "torch;metatomic_torch;metatensor_torch;featomic::shared"
65
65
  )
66
66
 
67
67
  # Load information for each installed configuration.
@@ -41,7 +41,7 @@ public:
41
41
  torch::Tensor all_positions,
42
42
  torch::Tensor all_cells,
43
43
  torch::IValue systems_start,
44
- metatensor_torch::TorchTensorBlock block
44
+ metatensor_torch::TensorBlock block
45
45
  );
46
46
 
47
47
  /// Backward step: get the gradients of some quantity `A` w.r.t. the outputs
@@ -5,7 +5,7 @@
5
5
 
6
6
  #include <featomic.hpp>
7
7
  #include <metatensor/torch.hpp>
8
- #include <metatensor/torch/atomistic.hpp>
8
+ #include <metatomic/torch.hpp>
9
9
 
10
10
  #include "featomic/torch/exports.h"
11
11
 
@@ -61,12 +61,12 @@ public:
61
61
  void set_selected_keys(torch::IValue selection);
62
62
 
63
63
  /// which gradients to keep in the output of a calculation
64
- std::vector<std::string> gradients = {};
64
+ std::vector<std::string> gradients;
65
65
 
66
66
  private:
67
- torch::IValue selected_samples_ = torch::IValue();
68
- torch::IValue selected_properties_ = torch::IValue();
69
- torch::IValue selected_keys_ = torch::IValue();
67
+ torch::IValue selected_samples_;
68
+ torch::IValue selected_properties_;
69
+ torch::IValue selected_keys_;
70
70
  };
71
71
 
72
72
  /// Custom class holder to store, serialize and load featomic calculators
@@ -99,9 +99,9 @@ public:
99
99
  return calculator_.cutoffs();
100
100
  }
101
101
 
102
- /// Run a calculation for the given `systems` using the given options
103
- metatensor_torch::TorchTensorMap compute(
104
- std::vector<metatensor_torch::System> systems,
102
+ /// Run a calculation for the given `systems` using the given options.
103
+ metatensor_torch::TensorMap compute(
104
+ std::vector<metatomic_torch::System> systems,
105
105
  TorchCalculatorOptions options = {}
106
106
  );
107
107
 
@@ -123,9 +123,9 @@ private:
123
123
  /// contain `"cell"` gradients.
124
124
  ///
125
125
  /// `forward_gradients` controls which gradients are left inside the TensorMap.
126
- metatensor_torch::TorchTensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
- std::vector<metatensor_torch::System> systems,
128
- metatensor_torch::TorchTensorMap precomputed,
126
+ metatensor_torch::TensorMap FEATOMIC_TORCH_EXPORT register_autograd(
127
+ std::vector<metatomic_torch::System> systems,
128
+ metatensor_torch::TensorMap precomputed,
129
129
  std::vector<std::string> forward_gradients
130
130
  );
131
131
 
@@ -7,21 +7,21 @@
7
7
  #include <torch/script.h>
8
8
 
9
9
  #include <featomic.hpp>
10
- #include <metatensor/torch/atomistic.hpp>
10
+ #include <metatomic/torch.hpp>
11
11
 
12
12
  #include "featomic/torch/exports.h"
13
13
 
14
14
  namespace featomic_torch {
15
15
 
16
- /// Implementation of `featomic::System` using `metatensor_torch::System` as
16
+ /// Implementation of `featomic::System` using `metatomic_torch::System` as
17
17
  /// backing memory for all the data.
18
18
  ///
19
19
  /// This can either be used with the Rust neighbor list implementation; or a set
20
20
  /// of pre-computed neighbor lists can be added to the system.
21
21
  class FEATOMIC_TORCH_EXPORT SystemAdapter final: public featomic::System {
22
22
  public:
23
- /// Create a `SystemAdapter` wrapping an existing `metatensor_torch::System`
24
- SystemAdapter(metatensor_torch::System system);
23
+ /// Create a `SystemAdapter` wrapping an existing `metatomic_torch::System`
24
+ SystemAdapter(metatomic_torch::System system);
25
25
 
26
26
  ~SystemAdapter() override = default;
27
27
 
@@ -84,7 +84,7 @@ public:
84
84
 
85
85
  private:
86
86
  // the origin of all the data
87
- metatensor_torch::System system_;
87
+ metatomic_torch::System system_;
88
88
 
89
89
  /// atomic types tensor, contiguous and on CPU
90
90
  torch::Tensor types_;