【发布时间】:2020-03-26 16:41:48
【问题描述】:
我是 PyTorch 的新手。 TensorFlow 有一个 API tf.cast() 和 tf.shape()。 tf.cast 在 TensorFlow 中具有特定用途,在火炬中有什么等价物吗? 我有张量 x= tensor(shape(128,64,32,32)): tf.shape(x) 创建维度为 1 的张量 x.shape 创建真实的方面。我需要在火炬中使用 tf.shape(x)。
tf.cast 的作用与仅仅改变torch 中的张量dtype 不同。
是否有人在 Torch/PyTorch 中有等效的 API。
【问题讨论】:
标签: python tensorflow pytorch