2017-12-26 11 views
0

TensorFlow 1.3.1에서 IsFiniteScalarF32 테스트가 오류 : "expected:false vs actual:true"으로 실패합니다. 명령 라인 (100) https://github.com/tensorflow/tensorflow/blob/v1.3.1/tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc#L100,에서 현재 bazel test -c opt //tensorflow/compiler/xla/tests:array_elementwise_ops_test_cpu_parallel디버깅 // tensorflow/compiler/xla/tests : array_elementwise_ops_test_cpu_parallel ppc64le에서 테스트 실패

내가 그러나 다음과 같은 오류지고, 실패를 디버깅 및 std::cout << "value is ***** \n" << result;를 사용하여 출력을 표시하는 시도 auto result = builder.IsFinite(builder.ConstantR0<float>(NAN));

의 출력을 확인하려는 오전 :

tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc:67:13: error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&' 
    std::cout << "value is ***** \n" << result; 
      ^
In file included from /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/iostream:39:0, 
       from tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc:21: 
/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ostream:602:5: error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = xla::ComputationDataHandle]' 
    operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) 

result 변수의 값을 어떻게 인쇄 할 수 있습니까?

답변

0

유형은 here으로 정의 된 프로토콜 버퍼입니다. 표시되는 오류는 프로토콜 버퍼에 대해 operator<<이 정의되어 있지 않기 때문입니다. 다음은 그러한 오류에 대한 설명입니다. std::vector : cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&'

cout << result.DebugString()을 사용할 수 있습니다.

이 값은 XLA 계산 ​​그래프에서 계산할 값에 대한 핸들이기 때문에 값이 임의의 숫자가됩니다.