Is that you are in graph mode so you will not going to change pmean and smean in the graph.
You can check yourself, add this in your call:
tf.print(smean)
tf.print(pmean)

You can see the difference when you reload and compile the Model to run in eager mode run_eagerly=True
See also:

  

      stackoverflow.com
  

  
      
    
  


  How to create a custom layer in Keras with 'stateful' variables/tensors? 3



  tensorflow, keras, recurrent-neural-network, layer



  asked by
  
  
    d_gg
  
  on 04:12PM - 08 Mar 20 UTC