@@ -173,7 +173,10 @@ mod impl_max {
173
173
type Output = Self ;
174
174
type GradLeft = Self ;
175
175
type GradRight = Self ;
176
- fn grad_max( self : Self , i: Self ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
176
+ fn grad_max(
177
+ self : Self ,
178
+ i: Self ,
179
+ ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
177
180
match self . cmp( & i) {
178
181
Ordering :: Less | Ordering :: Equal => ( i, ( Self :: zero( ) , Self :: one( ) ) ) ,
179
182
Ordering :: Greater => ( self , ( Self :: one( ) , Self :: zero( ) ) ) ,
@@ -191,7 +194,10 @@ mod impl_max {
191
194
type Output = Self ;
192
195
type GradLeft = Self ;
193
196
type GradRight = Self ;
194
- fn grad_max( self : Self , i: Self ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
197
+ fn grad_max(
198
+ self : Self ,
199
+ i: Self ,
200
+ ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
195
201
match self . partial_cmp( & i) . unwrap( ) {
196
202
Ordering :: Less | Ordering :: Equal => ( i, ( Self :: zero( ) , Self :: one( ) ) ) ,
197
203
Ordering :: Greater => ( self , ( Self :: one( ) , Self :: zero( ) ) ) ,
@@ -215,7 +221,10 @@ mod impl_min {
215
221
type Output = Self ;
216
222
type GradLeft = Self ;
217
223
type GradRight = Self ;
218
- fn grad_min( self : Self , i: Self ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
224
+ fn grad_min(
225
+ self : Self ,
226
+ i: Self ,
227
+ ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
219
228
match self . partial_cmp( & i) . unwrap( ) {
220
229
Ordering :: Less | Ordering :: Equal => ( self , ( Self :: one( ) , Self :: zero( ) ) ) ,
221
230
Ordering :: Greater => ( i, ( Self :: zero( ) , Self :: one( ) ) ) ,
@@ -233,7 +242,10 @@ mod impl_min {
233
242
type Output = Self ;
234
243
type GradLeft = Self ;
235
244
type GradRight = Self ;
236
- fn grad_min( self : Self , i: Self ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
245
+ fn grad_min(
246
+ self : Self ,
247
+ i: Self ,
248
+ ) -> ( Self :: Output , ( Self :: GradLeft , Self :: GradRight ) ) {
237
249
match self . partial_cmp( & i) . unwrap( ) {
238
250
Ordering :: Less | Ordering :: Equal => ( self , ( Self :: one( ) , Self :: zero( ) ) ) ,
239
251
Ordering :: Greater => ( i, ( Self :: zero( ) , Self :: one( ) ) ) ,
@@ -325,7 +337,6 @@ mod impl_div {
325
337
impl_trait ! [ parse, i8 , i16 , i32 , i64 , i128 , isize , f32 , f64 ] ;
326
338
}
327
339
328
-
329
340
// impl_trait![
330
341
// GradPow,
331
342
// fn grad_pow(self, i: u32) -> (Self, (Self,)) {
@@ -382,7 +393,6 @@ mod impl_div {
382
393
// f64
383
394
// ];
384
395
385
-
386
396
#[ cfg( test) ]
387
397
mod tests {
388
398
use super :: * ;
0 commit comments