เทนเซอร์โฟลว์:: ออปส์:: คอส

#include <math_ops.h>

คำนวณค่า cos ของ x ทีละองค์ประกอบ

สรุป

ฟังก์ชันนี้รับเทนเซอร์เป็นอินพุต และคำนวณค่าโคไซน์ของทุกองค์ประกอบในเทนเซอร์นั้น ช่วง ของอินพุต คือ (-inf, inf) และช่วงของเอาต์พุตคือ [-1,1] หากอินพุตอยู่นอกขอบเขต จะส่งคืนค่า nan

  x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10000, float("inf")])
  tf.math.cos(x) ==> [nan -0.91113025 0.87758255 0.5403023 0.36235774 0.48718765 -0.95215535 nan]
  

ข้อโต้แย้ง:

การส่งคืนสินค้า:

  • Output : เทนเซอร์ y

ตัวสร้างและตัวทำลาย

Cos (const :: tensorflow::Scope & scope, :: tensorflow::Input x)

คุณลักษณะสาธารณะ

operation
y

หน้าที่สาธารณะ

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

คุณลักษณะสาธารณะ

การดำเนินการ

Operation operation

y

::tensorflow::Output y

หน้าที่สาธารณะ

คอส

 Cos(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x
)

โหนด

::tensorflow::Node * node() const 

ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต

 operator::tensorflow::Input() const 

ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต

 operator::tensorflow::Output() const