【发布时间】:2021-03-13 03:53:59
【问题描述】:
我是张量流的新用户。我有以下张量 A:
<tf.Tensor: shape=(3,), dtype=string, numpy=
array([b'1,2.0,32.29,42.1,16.0,0.60,46.0,0.0,26.0,0.0,-1.31,-0.9'],
dtype=object)>
我想得到以下两个张量:
张量 B:将张量 A 转换为浮点张量并获取张量 A 的第一个元素:
<tf.Tensor: shape=(3,), dtype=float, numpy=
array([1],
dtype=object)>
张量 C:将张量 A 转换为浮点张量并提取张量 B 的最后 4 个元素
<tf.Tensor: shape=(3,), dtype=float, numpy=
array([26.0,0.0,-1.31,-0.9],
dtype=object)>
能否请您告诉我如何从张量 A 中获得张量 B 和张量 C?文档令人困惑。
【问题讨论】:
标签: python tensorflow tensorflow2.0 tensor tensorflow-datasets