I have three functions in file fe_extraction.py
def rms_value(x):
return tf.sqrt(tf.reduce_mean(tf.square(x)))
def meanabs(x):
return tf.reduce_mean(tf.abs(x))
def req_value(x,y,Thersh):
z = tf.cond(y>Thersh,rms_freq(x),peak_value(x))
return z
I want to simply apply a condition if y > thershold perform rms_freq(x) or else peak_value(x) and return that value. y is the value obtained from another function.
# given values
# Thershold = 10.69
# x is defined as tf.Variable , dtype tf.float64
# y = 45.34 obtained from function
....
z = fe_extraction.req_value(x,y,Thershold)
I get error as TypeError:fn1 must be callable.