Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CM-GP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Setting up 2FA is now mandatory for all users.
Show more breadcrumbs
Senne Deproost
CM-GP
Commits
050da0f2
Commit
050da0f2
authored
8 months ago
by
Senne Deproost
Browse files
Options
Downloads
Patches
Plain Diff
__str__ returns program instructions
parent
c0055bb4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
postfix_program.py
+3
-1
3 additions, 1 deletion
postfix_program.py
with
3 additions
and
1 deletion
postfix_program.py
+
3
−
1
View file @
050da0f2
...
...
@@ -59,6 +59,9 @@ class Program:
assert
size
is
not
None
,
"
If genome is not specified, size must be given
"
self
.
genome
=
np
.
ones
(
size
)
def
__str__
(
self
):
return
f
'
{
self
.
run_program
(
inp
=
[
1
],
do_print
=
True
)
}
'
def
__call__
(
self
,
inp
,
len_output
=
None
,
do_print
=
False
):
res
=
self
.
run_program
(
inp
,
do_print
=
do_print
)
...
...
@@ -72,7 +75,6 @@ class Program:
return
res
else
:
return
np
.
array
(
res
)
#return th.Tensor(res)
def
run_program
(
self
,
inp
,
do_print
=
False
):
stack
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment