简体   繁体   English

TensorFlow中Tensor上特定列的操作

[英]Operations on Specific Columns on a Tensor in TensorFlow

I've started using TensorFlow recently and am confused on how to approach column specific operations. 我最近开始使用TensorFlow,并且对如何进行列特定操作感到困惑。 The tensor I am dealing with is shaped [? 我要处理的张量是[[? , 12] and I want to multiply columns: 1 , 4 , 7, and 10 by 200 and for one column I want to round each value in it to nearest integer. ,[12],我想将1,4,7和10列乘以200,对于一列,我想将其中的每个值四舍五入为最接近的整数。 I've looked at the docs but have found no concrete way to accomplish this task. 我看过文档,但没有找到完成此任务的具体方法。 Speaking generically how can I execute these operations in TensorFlow? 概括地说,如何在TensorFlow中执行这些操作? Is there no operator to retrieve specific columns and/or do operations on them? 是否没有运算符来检索特定列和/或对其进行操作?

我相信您正在寻找tf.slice

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM