You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/paddle/fluid/dygraph/dygraph_to_static/error.py
+23-12Lines changed: 23 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,23 @@ def formated_message(self):
143
143
returnmsg+'\n'.join(self.source_code) +'\n'
144
144
145
145
146
+
classSuggestionDict(object):
147
+
def__init__(self):
148
+
# {(keywords): (suggestions)}
149
+
self.suggestion_dict= {
150
+
('is not initialized.', 'Hint:', 'IsInitialized'):
151
+
("Please ensure all your sublayers are inheritted from nn.Layer.",
152
+
"Please ensure there is no tensor created explicitly depended on external data, we suggest to register it as buffer tensor. See https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/04_dygraph_to_static/export_model/principle_cn.html#parameters-buffers for details"
153
+
)
154
+
}
155
+
156
+
defkeys(self):
157
+
returnself.suggestion_dict.keys()
158
+
159
+
def__getitem__(self, key):
160
+
returnself.suggestion_dict[key]
161
+
162
+
146
163
classErrorData(object):
147
164
"""
148
165
Error data attached to an exception which is raised in un-transformed code.
('is not initialized.', 'Hint:', 'IsInitialized'): [
222
-
"Ensure all sublayers inherit nn.Layer.",
223
-
"Ensure layer's inputs should be buffer Variables. For more information, please refer to: https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/04_dygraph_to_static/export_model/principle_cn.html#parameters-buffers"
0 commit comments