![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
masterShaw
这个作者很懒,什么都没留下…
展开
-
TensorFlow:判断CUDA和GPU是否可用
判断CUDA是否可用:tf.test.is_built_with_cuda()判断GPU是否可用:tf.test.is_gpu_available(cuda_only=False, min_cuda_compute_capability=None)可用时:不可用时:转载 2021-09-15 00:11:47 · 807 阅读 · 0 评论 -
tf/torch 更新/赋值tensor
tf.assign(不好用,千万别用。请用tf.scatter_update方法)def t6(): """ success Returns: """ sess = tf.Session() a = tf.get_variable(dtype=tf.int32, shape=[10, 3], name='item_table') print(a) a = a[5,:].assign([100,100,100]) print(a)原创 2021-07-19 11:34:28 · 1387 阅读 · 0 评论