Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wux_labs
Tensorflow
提交
104a469d
T
Tensorflow
项目概览
wux_labs
/
Tensorflow
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tensorflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
104a469d
编写于
7月 16, 2019
作者:
T
TensorFlower Gardener
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #30614 from ROCmSoftwarePlatform:google_upstream_einsum_op
PiperOrigin-RevId: 258349270
上级
69fdaa00
ff31f0bc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
12 deletion
+18
-12
tensorflow/core/kernels/einsum_op.cc
tensorflow/core/kernels/einsum_op.cc
+14
-8
tensorflow/core/kernels/einsum_op.h
tensorflow/core/kernels/einsum_op.h
+2
-2
tensorflow/core/kernels/einsum_op_gpu.cu.cc
tensorflow/core/kernels/einsum_op_gpu.cu.cc
+2
-2
未找到文件。
tensorflow/core/kernels/einsum_op.cc
浏览文件 @
104a469d
...
@@ -14,9 +14,9 @@ limitations under the License.
...
@@ -14,9 +14,9 @@ limitations under the License.
==============================================================================*/
==============================================================================*/
#define EIGEN_USE_THREADS
#define EIGEN_USE_THREADS
#if GOOGLE_CUDA
#if GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#define EIGEN_USE_GPU
#define EIGEN_USE_GPU
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#include "tensorflow/core/kernels/einsum_op.h"
#include "tensorflow/core/kernels/einsum_op.h"
...
@@ -39,9 +39,9 @@ limitations under the License.
...
@@ -39,9 +39,9 @@ limitations under the License.
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/util/einsum_op_util.h"
#include "tensorflow/core/util/einsum_op_util.h"
#if GOOGLE_CUDA
#if GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#include "tensorflow/core/kernels/reduction_ops_common_gpu.h"
#include "tensorflow/core/kernels/reduction_ops_common_gpu.h"
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
namespace
tensorflow
{
namespace
tensorflow
{
...
@@ -709,7 +709,7 @@ class EinsumOp : public OpKernel {
...
@@ -709,7 +709,7 @@ class EinsumOp : public OpKernel {
bool
output_has_ellipsis_
=
false
;
bool
output_has_ellipsis_
=
false
;
};
};
#if GOOGLE_CUDA
#if GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
// Forward declarations of the functor specializations for GPU.
// Forward declarations of the functor specializations for GPU.
namespace
functor
{
namespace
functor
{
#define DECLARE_GPU_SPEC(T, N) \
#define DECLARE_GPU_SPEC(T, N) \
...
@@ -736,12 +736,15 @@ namespace functor {
...
@@ -736,12 +736,15 @@ namespace functor {
DECLARE_GPU_SPECS
(
double
);
DECLARE_GPU_SPECS
(
double
);
DECLARE_GPU_SPECS
(
float
);
DECLARE_GPU_SPECS
(
float
);
// TODO(rocm): Enable once complex types are supported.
#if GOOGLE_CUDA
DECLARE_GPU_SPECS
(
complex64
);
DECLARE_GPU_SPECS
(
complex64
);
DECLARE_GPU_SPECS
(
complex128
);
DECLARE_GPU_SPECS
(
complex128
);
#endif
#undef DECLARE_GPU_SPEC
#undef DECLARE_GPU_SPEC
#undef DECLARE_GPU_SPECS
#undef DECLARE_GPU_SPECS
}
// namespace functor
}
// namespace functor
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#define REGISTER_EINSUM(D, TYPE) \
#define REGISTER_EINSUM(D, TYPE) \
REGISTER_KERNEL_BUILDER( \
REGISTER_KERNEL_BUILDER( \
...
@@ -755,14 +758,17 @@ TF_CALL_complex64(REGISTER_CPU);
...
@@ -755,14 +758,17 @@ TF_CALL_complex64(REGISTER_CPU);
TF_CALL_complex128
(
REGISTER_CPU
);
TF_CALL_complex128
(
REGISTER_CPU
);
#undef REGISTER_CPU
#undef REGISTER_CPU
#if GOOGLE_CUDA
#if GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#define REGISTER_GPU(TYPE) REGISTER_EINSUM(GPU, TYPE)
#define REGISTER_GPU(TYPE) REGISTER_EINSUM(GPU, TYPE)
TF_CALL_float
(
REGISTER_GPU
);
TF_CALL_float
(
REGISTER_GPU
);
TF_CALL_double
(
REGISTER_GPU
);
TF_CALL_double
(
REGISTER_GPU
);
// TODO(rocm): Enable once complex types are supported.
#if GOOGLE_CUDA
TF_CALL_complex64
(
REGISTER_GPU
);
TF_CALL_complex64
(
REGISTER_GPU
);
TF_CALL_complex128
(
REGISTER_GPU
);
TF_CALL_complex128
(
REGISTER_GPU
);
#endif
#undef REGISTER_GPU
#undef REGISTER_GPU
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#undef REGISTER_EINSUM
#undef REGISTER_EINSUM
...
...
tensorflow/core/kernels/einsum_op.h
浏览文件 @
104a469d
...
@@ -18,9 +18,9 @@ limitations under the License.
...
@@ -18,9 +18,9 @@ limitations under the License.
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/framework/tensor_types.h"
#if GOOGLE_CUDA
#if GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#define EIGEN_USE_GPU
#define EIGEN_USE_GPU
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
namespace
tensorflow
{
namespace
tensorflow
{
namespace
functor
{
namespace
functor
{
...
...
tensorflow/core/kernels/einsum_op_gpu.cu.cc
浏览文件 @
104a469d
...
@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
...
@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#if GOOGLE_CUDA
#if GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
#define EIGEN_USE_GPU
#define EIGEN_USE_GPU
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/register_types.h"
...
@@ -43,4 +43,4 @@ TF_CALL_complex128(DECLARE_GPU_SPECS);
...
@@ -43,4 +43,4 @@ TF_CALL_complex128(DECLARE_GPU_SPECS);
}
// namespace tensorflow
}
// namespace tensorflow
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA
|| TENSORFLOW_USE_ROCM
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录