def test_print_summary_for_keras_model(): # Note: best to use `grid` formatting for `tf.keras.Model` printing # because of the duplicates in the references to the variables. assert tabulate_module_summary(C(), tablefmt="grid") == example_tf_keras_model
def test_print_summary_output_string_with_positive_minimum(): with as_context(Config(positive_minimum=1e-6)): print(tabulate_module_summary(create_kernel())) assert tabulate_module_summary( create_kernel()) == kernel_param_print_string_with_shift
def get_summary(module: tf.Module): """ Returns a summary of the parameters and variables contained in a tf.Module. """ return tabulate_module_summary(module, None)
def test_print_summary_output_string(module_callable, expected_param_print_string): with as_context(Config(positive_minimum=None)): assert tabulate_module_summary( module_callable()) == expected_param_print_string
def test_print_summary_output_string(module_callable, expected_param_print_string): assert tabulate_module_summary( module_callable()) == expected_param_print_string