提交 bbcf1ad2 编写于 作者: F fengjiayi

update

上级 fb08e163
...@@ -87,8 +87,13 @@ def memory_usage(program, batch_size): ...@@ -87,8 +87,13 @@ def memory_usage(program, batch_size):
continue continue
data_count = 1 data_count = 1
neg_dim_count = 0
for x in var.shape: for x in var.shape:
if x < 0: if x < 0:
if neg_dim_count >= 1:
raise ValueError("Var %s has more than one negtive dim."
% (var_name))
neg_dim_count += 1
data_count *= batch_size * (-x) data_count *= batch_size * (-x)
else: else:
data_count *= x data_count *= x
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册