提交 e0273f04 authored 作者: Frederic Bastien's avatar Frederic Bastien

comment more clear and index fix following code review.

上级 4ae8a742
...@@ -3418,9 +3418,10 @@ def stack(*tensors): ...@@ -3418,9 +3418,10 @@ def stack(*tensors):
# If all tensors are scalars of the same type, call make_vector. # If all tensors are scalars of the same type, call make_vector.
# It makes the graph simpler, by not adding DimShuffles and Rebroadcasts # It makes the graph simpler, by not adding DimShuffles and Rebroadcasts
# Why this is not an optimization? # This should be an optimization!
# This make the graph less canonicalized(more type need to be understood by all optimization) # Doing it here make the graph less canonicalized
# DebugMode can't detect error in this code as it is not in an optimization. # (more type need to be understood by all optimization)
# And DebugMode can't detect error in this code as it is not in an optimization.
if numpy.all([isinstance(t, (numpy.number, float, int, python_complex)) or #in case their is direct int if numpy.all([isinstance(t, (numpy.number, float, int, python_complex)) or #in case their is direct int
(isinstance(t, Variable) and (isinstance(t, Variable) and
isinstance(t.type, TensorType) and isinstance(t.type, TensorType) and
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论