tf.expand_dims() 在指定维度扩充数据的维度,对应torch.unsqueeze() tf.transpose() 对输入张量进行维度的转换,对应torch.permute() tf.cast() 将目标张量转换成制定类型的数据,示例: import tensorflow as tf x = tf.constant([1.2, 3.3, 5.1]) x_int = tf.cast