Ai
1 Star 0 Fork 0

Houor/ml-py

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tf_test.py 419 Bytes
一键复制 编辑 原始数据 按行查看 历史
Houor 提交于 2020-01-18 20:13 +08:00 . tensor test
import tensorflow as tf
with tf.device("cpu"):
a = tf.constant([1])
print(a)
print(a.device)
print(a.numpy())
print(a.ndim)
print(a.dtype)
print(tf.is_tensor(a))
b = tf.ones([2])
print(b)
print(b.numpy())
b = tf.ones([2, 3])
print(b)
print(b.numpy())
c = tf.random.normal([2, 2], mean=1, stddev=1)
print(c)
print(c.numpy())
# 随机打散
idx = tf.range(10)
print(idx)
idx = tf.random.shuffle(idx)
print(idx)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/houor/ml-py.git
git@gitee.com:houor/ml-py.git
houor
ml-py
ml-py
master

搜索帮助