Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
xerus
xerus
Commits
325e579a
Commit
325e579a
authored
Dec 04, 2020
by
Philipp Trunschke
Browse files
make TTOperator picklable
parent
9c39279d
Pipeline
#2152
failed with stages
in 4 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/xerus/python/ttnetwork.cpp
View file @
325e579a
...
...
@@ -79,6 +79,14 @@ void expose_ttnetwork(module& m) {
m
.
def
(
"dyadic_product"
,
static_cast
<
TTTensor
(
*
)(
const
std
::
vector
<
TTTensor
>
&
)
>
(
&
dyadic_product
));
class_
<
TTOperator
,
TensorNetwork
>
(
m
,
"TTOperator"
)
.
def
(
pickle
(
[](
const
TTTensor
&
_self
)
{
// __getstate__
return
bytes
(
misc
::
serialize
(
_self
));
},
[](
bytes
_bytes
)
{
// __setstate__
return
misc
::
deserialize
<
TTTensor
>
(
_bytes
);
}
))
.
def
(
init
<
const
Tensor
&>
())
.
def
(
init
<
const
Tensor
&
,
value_t
>
())
.
def
(
init
<
const
Tensor
&
,
value_t
,
size_t
>
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment