Commit aa1fe45 1 parent 43b755a commit aa1fe45 Copy full SHA for aa1fe45
File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ of the `torch::Tensor` C++ class. The interface is designed to be familiar to
9
9
Fortran programmers, whilst retaining strong similarity with ` torch::Tensor ` and
10
10
the ` torch.Tensor ` Python class.
11
11
12
+ Under the hood, the ` torch_tensor ` type holds a pointer to a ` torch::Tensor `
13
+ object in C++ (implemented using ` c_ptr ` from the ` iso_c_binding ` intrinsic
14
+ module). This allows us to avoid unnecessary data copies between C++ and
15
+ Fortran.
16
+
12
17
## Procedures
13
18
14
19
### Constructors
@@ -26,6 +31,11 @@ include:
26
31
the data is * not* copied - the tensor data points to the Fortran array,
27
32
meaning the array must have been declared with the ` target ` property.
28
33
34
+ It is * compulsory* to call one of the constructors before interacting with it in
35
+ any of the ways described in the following. Each of the constructors sets the
36
+ pointer attribute of the ` torch_tensor ` ; without this being set, most of the
37
+ other operations are meaningless.
38
+
29
39
### Tensor interrogation
30
40
31
41
We provide several subroutines for interrogating ` torch_tensor ` objects. These
You can’t perform that action at this time.
0 commit comments