This repository was archived by the owner on Jul 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Sources/TensorFlow/Operators Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -576,6 +576,15 @@ public extension Tensor {
576
576
}
577
577
}
578
578
579
+ public extension Tensor where Scalar: Numeric {
580
+ /// Returns a `Tensor` by clipping tensor values to a specified min and max.
581
+ @inlinable
582
+ @differentiable ( wrt: self where Scalar: TensorFlowFloatingPoint)
583
+ func clipped( min minimum: Tensor , max maximum: Tensor ) -> Tensor {
584
+ return Raw . clipByValue ( t: self , clipValueMin: minimum, clipValueMax: maximum)
585
+ }
586
+ }
587
+
579
588
//===------------------------------------------------------------------------------------------===//
580
589
// Broadcasting
581
590
//===------------------------------------------------------------------------------------------===//
@@ -611,14 +620,6 @@ public extension Tensor {
611
620
}
612
621
613
622
public extension Tensor where Scalar: Numeric {
614
-
615
- /// Returns a `Tensor` by clipping tensor values to a specified min and max.
616
- @inlinable
617
- @differentiable ( wrt: self where Scalar: TensorFlowFloatingPoint)
618
- func clipped( min minimum: Tensor , max maximum: Tensor ) -> Tensor {
619
- return Raw . clipByValue ( t: self , clipValueMin: minimum, clipValueMax: maximum)
620
- }
621
-
622
623
@inlinable
623
624
@differentiable ( wrt: self where Scalar: TensorFlowFloatingPoint)
624
625
func unbroadcasted( toShape otherShape: Tensor < Int32 > ) -> Tensor {
You can’t perform that action at this time.
0 commit comments