Рассмотрим следующее (работает на colab):
a = np.array([
[ 0.9951848 +0.09801677j, 0.77301085+0.6343928j , 0.29028502+0.95694023j ],
[-0.55557 +0.8314698j , -0.83146954+0.5555703j , -0.98078525+0.19509049j],
[-0.47139683-0.88192123j, -0.29028472-0.9569403j , -0.09801722-0.9951847j ]
], dtype=np.complex64)
x = np.matmul(a, a.conj().T)
a_tf = tf.convert_to_tensor(a)
x_tf = tf.matmul(a_tf, tf.transpose(tf.math.conj(a_tf)))
x == x_tf
Это дает разные результаты:
<tf.Tensor: shape=(3, 3), dtype=bool, numpy=
array([[ True, True, False],
[ True, True, False],
[ True, True, False]])>
Где входные данные для tf.matmul
& np.matmul
равны. Есть ли логическое объяснение этому?