前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >tensorflow: tf.reshape探究

tensorflow: tf.reshape探究

作者头像
JNingWei
发布2018-09-28 16:19:46
5610
发布2018-09-28 16:19:46
举报
文章被收录于专栏:JNing的专栏JNing的专栏

tf.reshape(tensor,shape,name=None)

  给定一个tensor,这个操作会返回一个有着跟原tensor一样的值且经过shape重塑过的张量。

  如果shape中存在值为-1的组成,被计算过的维度总和的大小将保持恒定。尤其是当一个为[-1]的shape被展平为一维,且shape最多只能存在一个-1。

  如果shape是一维或者是更高维度,那么这个操作将会返回一个形状为shape,填充满value值的张量。在这种情况下,shape的元素的数量必须与tensor的元素数量一样。

Args

Annotations

tensor

A Tensor.

shape

A Tensor. Must be one of the following types: int32, int64. Defines the shape of the output tensor.

name

A name for the operation (optional).

Returns:

  A Tensor. Has the same type as tensor.



本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年06月22日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • tf.reshape(tensor,shape,name=None)
    • Returns:
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档