提交 271dbdc2 authored 作者: Paul Christiano's avatar Paul Christiano

Changed docstring for subtensor optimization

上级 1b89d217
......@@ -2181,10 +2181,13 @@ def local_subtensor_of_alloc(node):
@gof.local_optimizer([Subtensor])
def local_subtensor_of_dot(node):
"""
This optimization translates T.dot(A, B)[idxs] into T.dot(A[idxs_a], B[idxs_b]).
idxs_a is the first A.ndim-1 entries of idxs
idxs_b is the remaining entries of idxs (if any),
but with : inserted in the second-to-last dimension (because dot sums over this dimension)
This optimization translates T.dot(A, B)[idxs] into T.dot(A[idxs_a], B[idxs_b]),
where idxs_a and idxs_b are defined appropriately.
idxs_a is the first A.ndim-1 entries of idxs,
and idxs_b is the remaining entries of idxs (if any),
modified to skip the second-to-last dimension of B
(because dot sums over this dimension)
"""
if not isinstance(node.op, Subtensor):
return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论