You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
that is :
if mat_ratio > 0 then mat_ratio = 1/mat_ratio
else mat_ratio = args.batch_size
the function tf.cond needs 3 parameters: condition, func1, func2
and if condition is true it return func1 ,otherwise func2
Here, 'x>0' is condition, 'lambda: 1/x' is func1 and 'lambda:float(args.batch_size)' is func2
and tf.map_fn need 2 parameters: function and its parameters list
the first lambda expression (lambda x: ... ) is just the function and the variable 'mat_ratio' is just the parameter list. Because the function 'lambda x: ...' needs only one parameter, the parameter list needed by 'tf.map_fn' is the single parameter 'mat_ratio' rather than a list
that is :
if mat_ratio > 0 then mat_ratio = 1/mat_ratio
else mat_ratio = args.batch_size
the function tf.cond needs 3 parameters: condition, func1, func2
and if condition is true it return func1 ,otherwise func2
Here, 'x>0' is condition, 'lambda: 1/x' is func1 and 'lambda:float(args.batch_size)' is func2
and tf.map_fn need 2 parameters: function and its parameters list
the first lambda expression (lambda x: ... ) is just the function and the variable 'mat_ratio' is just the parameter list. Because the function 'lambda x: ...' needs only one parameter, the parameter list needed by 'tf.map_fn' is the single parameter 'mat_ratio' rather than a list
so damn hard to understand. can someone help me~~~~~~~~
The text was updated successfully, but these errors were encountered: