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 +8
-6
lines changed
Sources/TensorFlow/Operators Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -214,12 +214,6 @@ public extension Tensor {
214
214
return Raw . squeeze ( self , squeezeDims: axes. map ( Int32 . init) )
215
215
}
216
216
217
- /// Returns a `Tensor` by clipping tensor values to a specified min and max.
218
- @inlinable
219
- @differentiable ( wrt: self where Scalar: TensorFlowFloatingPoint)
220
- func clipped< T> ( min minimum: Tensor < T > , max maximum: Tensor < T > ) -> Tensor {
221
- return Raw . clipByValue ( t: self , clipValueMin: minimum, clipValueMax: maximum)
222
- }
223
217
}
224
218
225
219
internal extension Tensor where Scalar: TensorFlowFloatingPoint {
@@ -617,6 +611,14 @@ public extension Tensor {
617
611
}
618
612
619
613
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
+
620
622
@inlinable
621
623
@differentiable ( wrt: self where Scalar: TensorFlowFloatingPoint)
622
624
func unbroadcasted( toShape otherShape: Tensor < Int32 > ) -> Tensor {
You can’t perform that action at this time.
0 commit comments