当前位置: 首页>>代码示例>>Python>>正文


Python ndarray.swapaxes方法代码示例

本文整理汇总了Python中mxnet.ndarray.swapaxes方法的典型用法代码示例。如果您正苦于以下问题:Python ndarray.swapaxes方法的具体用法?Python ndarray.swapaxes怎么用?Python ndarray.swapaxes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mxnet.ndarray的用法示例。


在下文中一共展示了ndarray.swapaxes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: subtract_imagenet_mean_batch

# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def subtract_imagenet_mean_batch(batch):
    """Subtract ImageNet mean pixel-wise from a BGR image."""
    batch = F.swapaxes(batch,0, 1)
    (r, g, b) = F.split(batch, num_outputs=3, axis=0)
    r = r - 123.680
    g = g - 116.779
    b = b - 103.939
    batch = F.concat(r, g, b, dim=0)
    batch = F.swapaxes(batch,0, 1)
    return batch 
开发者ID:awslabs,项目名称:dynamic-training-with-apache-mxnet-on-aws,代码行数:12,代码来源:utils.py

示例2: subtract_imagenet_mean_preprocess_batch

# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def subtract_imagenet_mean_preprocess_batch(batch):
    """Subtract ImageNet mean pixel-wise from a BGR image."""
    batch = F.swapaxes(batch,0, 1)
    (r, g, b) = F.split(batch, num_outputs=3, axis=0)
    r = r - 123.680
    g = g - 116.779
    b = b - 103.939
    batch = F.concat(b, g, r, dim=0)
    batch = F.swapaxes(batch,0, 1)
    return batch 
开发者ID:awslabs,项目名称:dynamic-training-with-apache-mxnet-on-aws,代码行数:12,代码来源:utils.py

示例3: add_imagenet_mean_batch

# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def add_imagenet_mean_batch(batch):
    batch = F.swapaxes(batch,0, 1)
    (b, g, r) = F.split(batch, num_outputs=3, axis=0)
    r = r + 123.680
    g = g + 116.779
    b = b + 103.939
    batch = F.concat(b, g, r, dim=0)
    batch = F.swapaxes(batch,0, 1)
    """
    batch = denormalizer(batch)
    """
    return batch 
开发者ID:awslabs,项目名称:dynamic-training-with-apache-mxnet-on-aws,代码行数:14,代码来源:utils.py

示例4: preprocess_batch

# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def preprocess_batch(batch):
    batch = F.swapaxes(batch, 0, 1)
    (r, g, b) = F.split(batch, num_outputs=3, axis=0)
    batch = F.concat(b, g, r, dim=0)
    batch = F.swapaxes(batch, 0, 1)
    return batch 
开发者ID:awslabs,项目名称:dynamic-training-with-apache-mxnet-on-aws,代码行数:8,代码来源:utils.py

示例5: swapaxes

# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def swapaxes(input, axis1, axis2):
    return nd.swapaxes(input, axis1, axis2) 
开发者ID:dmlc,项目名称:dgl,代码行数:4,代码来源:tensor.py


注:本文中的mxnet.ndarray.swapaxes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。