def test_pad_default(self, xp, dtype):
array = xp.array(self.array, dtype=dtype)
# Older version of NumPy(<1.12) can emit ComplexWarning
def f():
return xp.pad(array, self.pad_width, mode=self.mode)
if xp is numpy:
with warnings.catch_warnings():
warnings.simplefilter('ignore', numpy.ComplexWarning)
return f()
else:
return f()
评论列表
文章目录