Issue 1:
System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Windows 10 v1803 Pro 64bit English

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:N/A

TensorFlow installed from (source or binary):source

TensorFlow version:1.12

Python version:3.6

Installed using virtualenv? pip? conda?:pip

Bazel version (if compiling from source):0.15

GCC/Compiler version (if compiling from source):MSVC 2015 update 3

CUDA/cuDNN version:N/A

GPU model and memory:N/A

Describe the problem

Provide the exact sequence of commands / steps that you executed before running into the problem

Commands

bazel build -c opt --verbose_failures //tensorflow/cc:tutorials_example_trainer

Steps

Setup as described in official document

.bazelrc is customized in the following way.

import (YOUR_TENSORFLOW_FOLDER)/tf_configure.bazelrc

.tf_configure.bazelrc is customized in the following way.

build:ignite --define with_ignite_support=true
build:xla --define with_xla_support=false
build --action_env TF_NEED_OPENCL_SYCL="0"
build --action_env TF_NEED_ROCM="0"
build --action_env TF_NEED_CUDA="0"
build --action_env TF_DOWNLOAD_CLANG="0"
build:opt --copt=/arch:AVX2
build:opt --define with_default_optimizations=true
build --copt=-w --host_copt=-w
build --verbose_failures
build --distinct_host_configuration=false
build --experimental_shortened_obj_file_path=true
build --define=no_tensorflow_py_deps=true
build --define=override_eigen_strong_inline=true
build:v2 --define=tf_api_version=2

Any other info / logs

unicode_script_op.lo.lib(unicode_script_op.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl icu_62::ErrorCode::~ErrorCode(void)" (__imp_??1ErrorCode@icu_62@@UEAA@XZ) referenced in function "public: virtual void __cdecl tensorflow::UnicodeScriptOp::Compute(class tensorflow::OpKernelContext *)" (?Compute@UnicodeScriptOp@tensorflow@@UEAAXPEAVOpKernelContext@2@@Z)
unicode_script_op.lo.lib(unicode_script_op.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: signed char __cdecl icu_62::ErrorCode::isSuccess(void)const " (__imp_?isSuccess@ErrorCode@icu_62@@QEBACXZ) referenced in function "public: virtual void __cdecl tensorflow::UnicodeScriptOp::Compute(class tensorflow::OpKernelContext *)" (?Compute@UnicodeScriptOp@tensorflow@@UEAAXPEAVOpKernelContext@2@@Z)
unicode_script_op.lo.lib(unicode_script_op.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum UErrorCode __cdecl icu_62::ErrorCode::reset(void)" (__imp_?reset@ErrorCode@icu_62@@QEAA?AW4UErrorCode@@XZ) referenced in function "public: virtual void __cdecl tensorflow::UnicodeScriptOp::Compute(class tensorflow::OpKernelContext *)" (?Compute@UnicodeScriptOp@tensorflow@@UEAAXPEAVOpKernelContext@2@@Z)
unicode_script_op.lo.lib(unicode_script_op.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) const icu_62::ErrorCode::`vftable'" (__imp_??_7ErrorCode@icu_62@@6B@) referenced in function "public: virtual void __cdecl tensorflow::UnicodeScriptOp::Compute(class tensorflow::OpKernelContext *)" (?Compute@UnicodeScriptOp@tensorflow@@UEAAXPEAVOpKernelContext@2@@Z)

Similar to tutorials_example_trainer, build //tensorflow/examples/label_image:label_image also failed.

Issue 2:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10

TensorFlow installed from (source or binary): Binary (Anaconda)

TensorFlow version (use command below): 1.13.1

Python version: 3.7.3

CUDA/cuDNN version: 10.0/7.6.0

GPU model and memory: NVIDIA Titan X (Pascal), 12 GB

Describe the current behavior

tf.einsum returns buggy values compared to np.einsum for identical parameters. Here is the current output (please find code below):

np: 8.610251426696777
tf: 0.0

Please also note that the same code works as expected when running on the CPU. It also works correctly on the GPU in TF 1.12.0, CUDA/cuDNN 9.0/7.3.1 and Python 3.6.8.

Describe the expected behavior

Here is the expected output:

np: 8.610251426696777
tf: 8.610251426696777

Code to reproduce the issue

from __future__ import (
absolute_import,
division,
print_function
)

import tensorflow as tf
import numpy as np

tf.enable_eager_execution()

einsum_string = "bijk,bijk->bij"

# load values
S_h_numpy = np.load("./S_h.npy")
S_h = tf.convert_to_tensor(S_h_numpy, dtype=tf.float32)

h_numpy = np.load("./h.npy")
h = tf.convert_to_tensor(
h_numpy,
dtype=tf.float32
)

# perform einsum
ht_S_h_numpy = np.einsum(einsum_string, h_numpy, S_h_numpy)
ht_S_h = tf.einsum(einsum_string, h, S_h)

print("np: {np_val}\ntf: {tf_val}".format(
np_val=ht_S_h_numpy[2, 191, 191],
tf_val=ht_S_h[2, 191, 191],
))

Other info / logs

Here are the input tensors used in the example: input_tensors.zip.

The tensors are of shape (4, 192, 192, 2). I could not choose a smaller example because the buggy values appear only in part of the second and all of the following batch items. The bug therefore seems to be connected to the size of the input.