You are presented with a multi-fault debugging task encompassing 3 distinct bugs within the Keras framework code. Your goal is to identify and resolve these bugs to restore proper functionality.
Bugs Overview:
Bug 1:
The functions responsible for updating tensor values (update, update_add, update_sub) do not correctly ensure that the returned tensor reflects the updated values. This means that the operations might not behave as expected, leading to potential inconsistencies in tensor values after updates.
Bug 2:
The weight standardization function can lead to situations where an inconsistency arises if both sample weights and class weights are provided. Currently, the implementation neglects to combine these weights appropriately, which may result in the wrong weight being applied when training the model.
Bug 3:
In the RNN layer implementation, the handling of the cell's state size is incorrect when determining the output shape. This error can cause issues when defining the architecture of the RNN, as the expected shape of the output and states may not align properly.
All buggy code resides in the file /app/solution.py. Your task is to fix all of the bugs listed above. Testing will be conducted through the import statement from solution import *, ensuring the correctness of your fixes.
Important:
You must address all bugs for the task to be considered complete. Good luck!
Note (env layout): The buggy starter code is at /setup_files/solution.py. The verifier and tests run against /app/solution.py. Read /setup_files/solution.py, fix the bugs, and write the corrected version to /app/solution.py.