tensorflow2.0

How can I access elements of a 3D tensor using specified indices in TensorFlow?

你说的曾经没有我的故事 提交于 2020-08-27 20:59:01
问题 I'm trying to get the rows of a 3D tensor in a specific order of indices. Here are the inputs: import tensorflow as tf matrix = tf.constant([ [[0, 1], [2, 3], [4, 5], [6, 7]], [[8, 9], [10, 11], [12, 13], [14, 15]], [[16, 17], [18, 19], [20, 21], [22, 23]], [[24, 25], [26, 27], [28, 29], [30, 31]], [[32, 33], [34, 35], [36, 37], [38, 39]] ]) indx = tf.constant([[3,2,1,0], [0,1,2,3], [1,0,3,2], [0,3,1,2], [1,2,3,0]]) # required output tensor: [[[6, 7], [4, 5], [2, 3], [0, 1]], [[8, 9], [10, 11

How can I access elements of a 3D tensor using specified indices in TensorFlow?

[亡魂溺海] 提交于 2020-08-27 20:58:26
问题 I'm trying to get the rows of a 3D tensor in a specific order of indices. Here are the inputs: import tensorflow as tf matrix = tf.constant([ [[0, 1], [2, 3], [4, 5], [6, 7]], [[8, 9], [10, 11], [12, 13], [14, 15]], [[16, 17], [18, 19], [20, 21], [22, 23]], [[24, 25], [26, 27], [28, 29], [30, 31]], [[32, 33], [34, 35], [36, 37], [38, 39]] ]) indx = tf.constant([[3,2,1,0], [0,1,2,3], [1,0,3,2], [0,3,1,2], [1,2,3,0]]) # required output tensor: [[[6, 7], [4, 5], [2, 3], [0, 1]], [[8, 9], [10, 11

How can I access elements of a 3D tensor using specified indices in TensorFlow?

安稳与你 提交于 2020-08-27 20:56:51
问题 I'm trying to get the rows of a 3D tensor in a specific order of indices. Here are the inputs: import tensorflow as tf matrix = tf.constant([ [[0, 1], [2, 3], [4, 5], [6, 7]], [[8, 9], [10, 11], [12, 13], [14, 15]], [[16, 17], [18, 19], [20, 21], [22, 23]], [[24, 25], [26, 27], [28, 29], [30, 31]], [[32, 33], [34, 35], [36, 37], [38, 39]] ]) indx = tf.constant([[3,2,1,0], [0,1,2,3], [1,0,3,2], [0,3,1,2], [1,2,3,0]]) # required output tensor: [[[6, 7], [4, 5], [2, 3], [0, 1]], [[8, 9], [10, 11

How can I access elements of a 3D tensor using specified indices in TensorFlow?

时间秒杀一切 提交于 2020-08-27 20:56:25
问题 I'm trying to get the rows of a 3D tensor in a specific order of indices. Here are the inputs: import tensorflow as tf matrix = tf.constant([ [[0, 1], [2, 3], [4, 5], [6, 7]], [[8, 9], [10, 11], [12, 13], [14, 15]], [[16, 17], [18, 19], [20, 21], [22, 23]], [[24, 25], [26, 27], [28, 29], [30, 31]], [[32, 33], [34, 35], [36, 37], [38, 39]] ]) indx = tf.constant([[3,2,1,0], [0,1,2,3], [1,0,3,2], [0,3,1,2], [1,2,3,0]]) # required output tensor: [[[6, 7], [4, 5], [2, 3], [0, 1]], [[8, 9], [10, 11

Why Tensorflow not running on GPU while GPU devices are identified in python?

a 夏天 提交于 2020-08-26 10:43:39
问题 I installed TensorFlow 2.2.0 and TensorFlow-gpu 2.2.0 in windows 10 . Also, I installed CUDA Toolkit v10.1 and copy cuDNN 7.6.5 files in CUDA directories . My GPU is NVIDIA GeForce 940 MX . In addition, I set CUDA Path on windows. When I test devices through the below code, both CPU and GPU are recognized: from tensorflow.python.client import device_lib device_lib.list_local_devices() The output is: [name: "/device:CPU:0" device_type: "CPU" memory_limit: 268435456 locality { } incarnation:

Why Tensorflow not running on GPU while GPU devices are identified in python?

北战南征 提交于 2020-08-26 10:42:46
问题 I installed TensorFlow 2.2.0 and TensorFlow-gpu 2.2.0 in windows 10 . Also, I installed CUDA Toolkit v10.1 and copy cuDNN 7.6.5 files in CUDA directories . My GPU is NVIDIA GeForce 940 MX . In addition, I set CUDA Path on windows. When I test devices through the below code, both CPU and GPU are recognized: from tensorflow.python.client import device_lib device_lib.list_local_devices() The output is: [name: "/device:CPU:0" device_type: "CPU" memory_limit: 268435456 locality { } incarnation: