提交 2e4e31be authored 作者: carriepl's avatar carriepl

Add comment explaining the position at which the AddFeatureOptimizer is included

上级 2fbb1ad0
...@@ -805,13 +805,14 @@ class Scan(PureOp): ...@@ -805,13 +805,14 @@ class Scan(PureOp):
# Add an optimization to the compilation mode to attach a feature # Add an optimization to the compilation mode to attach a feature
# to the function graph just before the inplace optimizations are # to the function graph just before the inplace optimizations are
# applied. This feature will prevent mitsot, sitsot and nitsot # applied (inplace optimizations start at position 50 so the
# outputs from being computed inplace (to allow their # optimization to attach the feature is registered at position 49.9
# preallocation). # so that it runs before them). This feature will prevent mitsot,
# sitsot and nitsot outputs from being computed inplace (to allow
# their preallocation).
mitsot_start = self.n_mit_mot_outs - len(preallocated_mitmot_outs) mitsot_start = self.n_mit_mot_outs - len(preallocated_mitmot_outs)
nitsot_end = (mitsot_start + self.n_mit_sot + self.n_sit_sot + nitsot_end = (mitsot_start + self.n_mit_sot + self.n_sit_sot +
self.n_nit_sot) self.n_nit_sot)
feature = NoOutputFromInplace(mitsot_start, nitsot_end) feature = NoOutputFromInplace(mitsot_start, nitsot_end)
opt = AddFeatureOptimizer(feature) opt = AddFeatureOptimizer(feature)
compilation_mode = self.mode_instance.register((opt, 49.9)) compilation_mode = self.mode_instance.register((opt, 49.9))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论