python - 如何用python生成恒等张量?
问题描述
解决方案
Instead of np.identity
use tf.eye
:
tf.eye(2)
# [[1., 0.],
# [0., 1.]]
推荐阅读
- java - TestNG - 如何在 testng 自定义电子邮件报告中打印运行时 testng 参数?
- java - 有没有办法验证像 gmail.net 这样的错误邮件域?
- angular - 在角度服务中的 HTML 请求之后在内部调用另一个 HTTP 请求
- java - 有没有办法在重启或突然关闭的情况下在多线程应用程序中保持状态
- javascript - 如何在 Vue CLI 3 中加载静态脚本文件
- r - 如何在矩阵列表中将格式更改为百分比
- delphi - 条形系列变化的 TChart 大小
- vector - 如何保护矢量不调整大小?
- laravel - Laravel 多对多关系更新
- jquery - 映射响应以创建动态表时出现问题