def test_elemwise_fusion_4d(self):
shp = (3, 3, 3, 3)
mode = copy.copy(compile.mode.get_default_mode())
# we need the optimisation enabled and the canonicalize.
# the canonicalize is needed to merge multiplication/addition by constant.
mode._optimizer = mode._optimizer.including(
'local_elemwise_fusion', 'composite_elemwise_fusion',
'canonicalize')
self.do(mode, shared, shp)
评论列表
文章目录