Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
loopy
Commits
0d56a417
Commit
0d56a417
authored
11 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
DomainParameterFinder: better error messages.
parent
32d5c889
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/kernel/tools.py
+10
-3
10 additions, 3 deletions
loopy/kernel/tools.py
with
10 additions
and
3 deletions
loopy/kernel/tools.py
+
10
−
3
View file @
0d56a417
...
...
@@ -296,7 +296,7 @@ def get_dot_dependency_graph(kernel, iname_cluster=False, iname_edge=True):
# {{{ domain parameter finder
class
DomainParameterFinder
:
class
DomainParameterFinder
(
object
)
:
"""
Finds parameters from shapes of passed arguments.
"""
def
__init__
(
self
,
kernel
):
...
...
@@ -343,8 +343,15 @@ class DomainParameterFinder:
if
param_name
not
in
kwargs
:
for
arg_name
,
axis_nr
,
shape_func
in
sources
:
if
arg_name
in
kwargs
:
result
[
param_name
]
=
shape_func
(
kwargs
[
arg_name
].
shape
[
axis_nr
])
try
:
shape_axis
=
kwargs
[
arg_name
].
shape
[
axis_nr
]
except
IndexError
:
raise
RuntimeError
(
"
Argument
'
%s
'
has unexpected shape.
"
"
Tried to access axis %d (0-based), only %d
"
"
axes present.
"
%
(
arg_name
,
axis_nr
,
len
(
kwargs
[
arg_name
].
shape
)))
result
[
param_name
]
=
shape_func
(
shape_axis
)
continue
return
result
...
...
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