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
19f6e4a4
Commit
19f6e4a4
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Declare FieldShapeSymbol and FieldStrideSymbol as strictly positive
parent
6942ed0b
No related branches found
No related tags found
1 merge request
!16
Declare FieldShapeSymbol and FieldStrideSymbol as strictly positive
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/data_types.py
+2
-2
2 additions, 2 deletions
pystencils/data_types.py
pystencils/kernelparameters.py
+2
-2
2 additions, 2 deletions
pystencils/kernelparameters.py
with
4 additions
and
4 deletions
pystencils/data_types.py
+
2
−
2
View file @
19f6e4a4
...
...
@@ -105,8 +105,8 @@ class TypedSymbol(sp.Symbol):
obj
=
TypedSymbol
.
__xnew_cached_
(
cls
,
*
args
,
**
kwds
)
return
obj
def
__new_stage2__
(
cls
,
name
,
dtype
):
obj
=
super
(
TypedSymbol
,
cls
).
__xnew__
(
cls
,
name
)
def
__new_stage2__
(
cls
,
name
,
dtype
,
*
args
,
**
kwargs
):
obj
=
super
(
TypedSymbol
,
cls
).
__xnew__
(
cls
,
name
,
*
args
,
**
kwargs
)
try
:
obj
.
_dtype
=
create_type
(
dtype
)
except
(
TypeError
,
ValueError
):
...
...
This diff is collapsed.
Click to expand it.
pystencils/kernelparameters.py
+
2
−
2
View file @
19f6e4a4
...
...
@@ -30,7 +30,7 @@ class FieldStrideSymbol(TypedSymbol):
def
__new_stage2__
(
cls
,
field_name
,
coordinate
):
name
=
"
_stride_{name}_{i}
"
.
format
(
name
=
field_name
,
i
=
coordinate
)
obj
=
super
(
FieldStrideSymbol
,
cls
).
__xnew__
(
cls
,
name
,
STRIDE_DTYPE
)
obj
=
super
(
FieldStrideSymbol
,
cls
).
__xnew__
(
cls
,
name
,
STRIDE_DTYPE
,
positive
=
True
)
obj
.
field_name
=
field_name
obj
.
coordinate
=
coordinate
return
obj
...
...
@@ -55,7 +55,7 @@ class FieldShapeSymbol(TypedSymbol):
def
__new_stage2__
(
cls
,
field_names
,
coordinate
):
names
=
"
_
"
.
join
([
field_name
for
field_name
in
field_names
])
name
=
"
_size_{names}_{i}
"
.
format
(
names
=
names
,
i
=
coordinate
)
obj
=
super
(
FieldShapeSymbol
,
cls
).
__xnew__
(
cls
,
name
,
SHAPE_DTYPE
)
obj
=
super
(
FieldShapeSymbol
,
cls
).
__xnew__
(
cls
,
name
,
SHAPE_DTYPE
,
positive
=
True
)
obj
.
field_names
=
tuple
(
field_names
)
obj
.
coordinate
=
coordinate
return
obj
...
...
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