Skip to content

Commit b32d289

Browse files
Shashi456saeta
authored andcommitted
Improving documentation in Math.swift tensorflow#160 (tensorflow#269)
* Improving documentation in Math.swift tensorflow#160 * Sign doc update
1 parent db42eb9 commit b32d289

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Sources/TensorFlow/Operators/Math.swift

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ func _vjpLog1p<T: TensorFlowFloatingPoint>(
576576
(log1p(x), { v in Raw.xdivy(v, 1 + x) })
577577
}
578578

579-
/// Returns `sin` of the specified tensor element-wise.
579+
/// Returns the sine of the specified tensor element-wise.
580580
@inlinable
581581
@differentiable(vjp: _vjpSin(_:))
582582
public func sin<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -590,7 +590,7 @@ internal func _vjpSin<T: TensorFlowFloatingPoint>(
590590
(sin(x), { v in v * cos(x) })
591591
}
592592

593-
/// Returns `cos` of the specified tensor element-wise.
593+
/// Returns the cosine of the specified tensor element-wise.
594594
@inlinable
595595
@differentiable(vjp: _vjpCos(_:))
596596
public func cos<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -604,7 +604,7 @@ internal func _vjpCos<T: TensorFlowFloatingPoint>(
604604
(cos(x), { v in -v * sin(x) })
605605
}
606606

607-
/// Returns `tan` of the specified tensor element-wise.
607+
/// Returns the tangent of the specified tensor element-wise.
608608
@inlinable
609609
@differentiable(vjp: _vjpTan(_:))
610610
public func tan<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -633,7 +633,7 @@ internal func _vjpSinh<T: TensorFlowFloatingPoint>(
633633
(sinh(x), { v in v * cosh(x) })
634634
}
635635

636-
/// Returns `cosh` of the specified tensor element-wise.
636+
/// Returns the hyperbolic cosine of the specified tensor element-wise.
637637
@inlinable
638638
@differentiable(vjp: _vjpCosh(_:))
639639
public func cosh<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -647,7 +647,7 @@ internal func _vjpCosh<T: TensorFlowFloatingPoint>(
647647
(cosh(x), { v in v * sinh(x) })
648648
}
649649

650-
/// Returns `tanh` of the specified tensor element-wise.
650+
/// Returns the hyperbolic tangent of the specified tensor element-wise.
651651
@inlinable
652652
@differentiable(vjp: _vjpTanh(_:))
653653
public func tanh<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -662,7 +662,7 @@ internal func _vjpTanh<T: TensorFlowFloatingPoint>(
662662
return (value, { v in v * (1 - value.squared()) })
663663
}
664664

665-
/// Returns `acos` of the specified tensor element-wise.
665+
/// Returns the inverse cosine of the specified tensor element-wise.
666666
@inlinable
667667
@differentiable(vjp: _vjpAcos(_:))
668668
public func acos<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -676,7 +676,7 @@ internal func _vjpAcos<T: TensorFlowFloatingPoint>(
676676
(acos(x), { v in -v / sqrt(1 - x.squared()) })
677677
}
678678

679-
/// Returns `asin` of the specified tensor element-wise.
679+
/// Returns the inverse sine of the specified tensor element-wise.
680680
@inlinable
681681
@differentiable(vjp: _vjpAsin(_:))
682682
public func asin<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -690,7 +690,7 @@ internal func _vjpAsin<T: TensorFlowFloatingPoint>(
690690
(asin(x), { v in v / sqrt(1 - x.squared()) })
691691
}
692692

693-
/// Returns `atan` of the specified tensor element-wise.
693+
/// Returns the inverse tangent of the specified tensor element-wise.
694694
@inlinable
695695
@differentiable(vjp: _vjpAtan(_:))
696696
public func atan<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -704,7 +704,7 @@ internal func _vjpAtan<T: TensorFlowFloatingPoint>(
704704
(atan(x), { v in v / (1 + x.squared()) })
705705
}
706706

707-
/// Returns `acosh` of the specified tensor element-wise.
707+
/// Returns the inverse hyperbolic cosine of the specified tensor element-wise.
708708
@inlinable
709709
@differentiable(vjp: _vjpAcosh(_:))
710710
public func acosh<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -718,7 +718,7 @@ internal func _vjpAcosh<T: TensorFlowFloatingPoint>(
718718
(acosh(x), { v in v / asinh(x) })
719719
}
720720

721-
/// Returns `asinh` of the specified tensor element-wise.
721+
/// Returns the inverse hyperbolic sine of the specified tensor element-wise.
722722
@inlinable
723723
@differentiable(vjp: _vjpAsinh(_:))
724724
public func asinh<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -732,7 +732,7 @@ internal func _vjpAsinh<T: TensorFlowFloatingPoint>(
732732
(asinh(x), { v in v / acosh(x) })
733733
}
734734

735-
/// Returns `atanh` of the specified tensor element-wise.
735+
/// Returns the inverse hyperbolic tangent of the specified tensor element-wise.
736736
@inlinable
737737
@differentiable(vjp: _vjpAtanh(_:))
738738
public func atanh<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -809,7 +809,7 @@ internal func _vjpRsqrt<T: TensorFlowFloatingPoint>(
809809
return (value, { v in -v / (2 * pow(x, 3 / 2)) })
810810
}
811811

812-
/// Returns `exp` of the specified tensor element-wise.
812+
/// Returns the exponential of the specified tensor element-wise.
813813
@inlinable
814814
@differentiable(vjp: _vjpExp(_:))
815815
public func exp<T: TensorFlowFloatingPoint>(_ x: Tensor<T>) -> Tensor<T> {
@@ -895,6 +895,8 @@ internal func _vjpFloor<T: TensorFlowFloatingPoint>(
895895
(floor(x), { _ in Tensor(0).broadcasted(like: x) })
896896
}
897897

898+
/// Returns an indication of the sign of the specified tensor element-wise.
899+
/// Specifically, computes `y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`.
898900
@inlinable
899901
@differentiable(vjp: _vjpSign(_:) where T: TensorFlowFloatingPoint)
900902
public func sign<T: Numeric>(_ x: Tensor<T>) -> Tensor<T> {
@@ -1036,7 +1038,7 @@ func _vjpLeakyRelu<T: TensorFlowFloatingPoint>(
10361038
})
10371039
}
10381040

1039-
/// Returns `relu` of the specified tensor element-wise.
1041+
/// Returns a tensor by applying the ReLU activation function to the specified tensor element-wise.
10401042
/// Specifically, computes `max(0, x)`.
10411043
@inlinable
10421044
@differentiable(vjp: _vjpRelu(_:))

0 commit comments

Comments
 (0)