import  numpy as np
anchors=np.ones((2,3))
anchor = np.broadcast_to(anchors, (5,)+anchors.shape) # 标红字体表达较为新颖(个人认为)
print(anchor)
print('anchors=',anchor.shape)
print('(5,)+anchors.shape=',(5,)+anchors.shape)
print('(4,)+(5,)+anchors.shape=',(4,)+(5,)+anchors.shape) 结果如下:

[[[1. 1. 1.]
[1. 1. 1.]]

[[1. 1. 1.]
[1. 1. 1.]]

[[1. 1. 1.]
[1. 1. 1.]]

[[1. 1. 1.]
[1. 1. 1.]]

[[1. 1. 1.]
[1. 1. 1.]]]
anchors= (5, 2, 3)
(5,)+anchors.shape= (5, 2, 3)
(4,)+(5,)+anchors.shape= (4, 5, 2, 3)

最新文章

  1. jQuery Colorbox弹窗插件使用教程小结、属性设置详解
  2. js == 与 === 的区别,‘’与“”的区别
  3. oracle11g的standby性能分析报告statpack安装
  4. Redis 下载
  5. Python字符串基础操作
  6. 解读 Windows Azure 存储服务的账单 – 带宽、事务数量,以及容量
  7. Show Global Status 整理
  8. eclipse tomcat内存设置
  9. 关于$.ajax的请求格式
  10. ASP.NET Core 返回 Json DateTime 格式
  11. 搭建 structs2 环境
  12. 20155324王鸣宇安装虚拟机+初次学习Linux的感想20155324
  13. 深入NAS协议系列: 召唤SMB2 OpLock/Lease
  14. scons, cmake, bazel
  15. 分布式实时日志系统(四) 环境搭建之centos 6.4下hbase 1.0.1 分布式集群搭建
  16. virtualbox+vagrant学习-5-Boxes-2-Box Versioning
  17. eclipse启动几秒后报错 (一闪而过)
  18. boost::io_service解读
  19. BZOJ 1604 [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居:队列 + multiset + 并查集【曼哈顿距离变形】
  20. 示例的libevent的程序

热门文章

  1. MariaDB设置主从复制
  2. 个人第2次作业:熟悉使用Git工具
  3. NLP中的预训练语言模型(三)—— XL-Net和Transformer-XL
  4. JS高阶---作用域与作用域链
  5. c#中几种数据结构
  6. C# 集合根据属性去重筛选
  7. arduino控制SIM900A模块
  8. c# 笔试面试题01
  9. Python程序设计例题
  10. 网络1911、1912 C语言第5次作业--循环结构 批改总结