Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
ac7e4ce2
Commit
ac7e4ce2
authored
7 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Removed warnings in tests
parent
7425762d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sympyextensions.py
+5
-2
5 additions, 2 deletions
sympyextensions.py
with
5 additions
and
2 deletions
sympyextensions.py
+
5
−
2
View file @
ac7e4ce2
...
...
@@ -7,7 +7,7 @@ import sympy as sp
from
sympy.functions
import
Abs
from
typing
import
Optional
,
Union
,
List
,
TypeVar
,
Iterable
,
Sequence
,
Callable
,
Dict
,
Tuple
from
pystencils.data_types
import
get_type_of_expression
,
get_base_type
from
pystencils.data_types
import
get_type_of_expression
,
get_base_type
,
cast_func
from
pystencils.assignment
import
Assignment
T
=
TypeVar
(
'
T
'
)
...
...
@@ -428,7 +428,7 @@ def count_operations(term: Union[sp.Expr, List[sp.Expr]],
for
a
in
t
.
args
:
if
a
==
1
or
a
==
-
1
:
result
[
'
muls
'
]
-=
1
elif
t
.
func
is
sp
.
Float
:
elif
isinstance
(
t
,
sp
.
Float
)
or
isinstance
(
t
,
sp
.
Rational
)
:
pass
elif
isinstance
(
t
,
sp
.
Symbol
):
visit_children
=
False
...
...
@@ -436,6 +436,9 @@ def count_operations(term: Union[sp.Expr, List[sp.Expr]],
visit_children
=
False
elif
t
.
is_integer
:
pass
elif
t
.
func
is
cast_func
:
visit_children
=
False
visit
(
t
.
args
[
0
])
elif
t
.
func
is
sp
.
Pow
:
if
check_type
(
t
.
args
[
0
]):
visit_children
=
False
...
...
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