本文整理汇总了Python中thunder.rdds.fileio.imagesloader.ImagesLoader.stdev方法的典型用法代码示例。如果您正苦于以下问题:Python ImagesLoader.stdev方法的具体用法?Python ImagesLoader.stdev怎么用?Python ImagesLoader.stdev使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thunder.rdds.fileio.imagesloader.ImagesLoader
的用法示例。
在下文中一共展示了ImagesLoader.stdev方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_stdev
# 需要导入模块: from thunder.rdds.fileio.imagesloader import ImagesLoader [as 别名]
# 或者: from thunder.rdds.fileio.imagesloader.ImagesLoader import stdev [as 别名]
def test_stdev(self):
from test_utils import elementwiseStdev
arys, shape, size = _generateTestArrays(2, 'uint8')
imageData = ImagesLoader(self.sc).fromArrays(arys)
stdval = imageData.stdev()
expected = elementwiseStdev([ary.astype('float16') for ary in arys])
assert_true(allclose(expected, stdval))
assert_equals('float64', str(stdval.dtype))
示例2: test_stdev
# 需要导入模块: from thunder.rdds.fileio.imagesloader import ImagesLoader [as 别名]
# 或者: from thunder.rdds.fileio.imagesloader.ImagesLoader import stdev [as 别名]
def test_stdev(self):
from test_utils import elementwise_stdev
arys, shape, size = _generate_test_arrays(2, 'uint8')
imagedata = ImagesLoader(self.sc).fromArrays(arys)
stdval = imagedata.stdev()
expected = elementwise_stdev([ary.astype('float16') for ary in arys])
assert_true(allclose(expected, stdval))
#assert_equals('float16', str(stdval.dtype))
# it isn't clear to me why this comes out as float32 and not float16, especially
# given that var returns float16, as expected. But I'm not too concerned about it.
# Consider this documentation of current behavior rather than a description of
# desired behavior.
assert_equals('float32', str(stdval.dtype))