diff --git a/src/finn/analysis/fpgadataflow/hls_synth_res_estimation.py b/src/finn/analysis/fpgadataflow/hls_synth_res_estimation.py index ff20adce6c513c212059373823ebf3aaf76b8cea..fe07b92a19683c035db6d710c8e58b6796555935 100644 --- a/src/finn/analysis/fpgadataflow/hls_synth_res_estimation.py +++ b/src/finn/analysis/fpgadataflow/hls_synth_res_estimation.py @@ -7,7 +7,7 @@ import finn.util.basic as util def hls_synth_res_estimation(model): """Extracts the results from the vivado synthesis. - Returns {node name : resource estimation}""" + Returns {node name : resource estimation}.""" res_dict = {} for node in model.graph.node: diff --git a/src/finn/analysis/fpgadataflow/res_estimation.py b/src/finn/analysis/fpgadataflow/res_estimation.py index eb2d81037774fe7f888c2b3f547da9288b2201e9..27ad91b857316c533b35621cfd51a8262d61f94b 100644 --- a/src/finn/analysis/fpgadataflow/res_estimation.py +++ b/src/finn/analysis/fpgadataflow/res_estimation.py @@ -4,7 +4,7 @@ import finn.util.basic as util def res_estimation(model): """Estimates the resources needed for the given model. - Returns {node name : resource estimation}""" + Returns {node name : resource estimation}.""" res_dict = {} for node in model.graph.node: diff --git a/src/finn/analysis/topology.py b/src/finn/analysis/topology.py index 9150e2b118cc9e17464e5c9866f83005576d40df..8f8d426dc4e1cbbae40c1976605c32f71599ef5f 100644 --- a/src/finn/analysis/topology.py +++ b/src/finn/analysis/topology.py @@ -4,7 +4,7 @@ import numpy as np def is_linear(model): """Checks whether the given model graph is linear. This is done by looking at the fan-out of each tensor. All tensors have a fan-out <= 1 in a linear - graph. Returns {"is_linear", Bool}""" + graph. Returns {"is_linear": Bool}.""" per_tensor_fanouts = get_per_tensor_fanouts(model) # check for tensors that have fanout > 1 multi_fanouts = list(filter(lambda x: x[1] > 1, per_tensor_fanouts.items())) @@ -12,7 +12,7 @@ def is_linear(model): def get_per_tensor_fanouts(model): - """Returns a dictionary of (tensor_name, tensor_fanout) for the model.""" + """Returns a dictionary of {tensor_name: tensor_fanout} for the model.""" # make execution context to get a list of tensors per_tensor_fanouts = model.make_empty_exec_context() # replace every tensor with its fanout @@ -23,7 +23,7 @@ def get_per_tensor_fanouts(model): def all_tensors_f32(model): """Checks whether all tensors have a float32 dtype, extra quantization - annotations notwithstanding.""" + annotations notwithstanding. Returns {"all_tensors_f32": Bool}.""" all_tensors = model.make_empty_exec_context().items() non_f32_tensors = filter(lambda x: x[1].dtype != np.float32, all_tensors) return {"all_tensors_f32": len(list(non_f32_tensors)) == 0} @@ -33,7 +33,8 @@ def node_inputs_in_expected_order(model): """Verifies that the node inputs are ordered in the way that FINN expects them. When a node has a mixture of static (= constant, initialized) inputs and dynamic inputs, the dynamic input should come first, followed by the - static one. Only verifiable for a small subset of op_types for now.""" + static one. Only verifiable for a small subset of op_types for now. Returns + {"node_inputs_in_expected_order": Bool}.""" op_types = ["MatMul", "Conv", "Add", "Mul"] nodes = filter(lambda x: x.op_type in op_types, model.graph.node) all_OK = True diff --git a/src/finn/analysis/verify_custom_nodes.py b/src/finn/analysis/verify_custom_nodes.py index 73d7ae590ac69226516ee1bf308ca6c2fbb41ce1..e49a0e77495a2d2daffbfb1eac010e656d183a8f 100644 --- a/src/finn/analysis/verify_custom_nodes.py +++ b/src/finn/analysis/verify_custom_nodes.py @@ -4,7 +4,8 @@ import finn.custom_op.registry as registry def verify_nodes(model): """Checks if custom ops in graph are correctly built, with all attributes and inputs. Returns {node op_type : info_messages} - *info_messages is list of strings about the result of the verification""" + + * info_messages: is list of strings about the result of the verification.""" verification_dict = {} for node in model.graph.node: