AddCLSToken#1575
Conversation
STFleming
left a comment
There was a problem hiding this comment.
Thanks Olly looks good! Just some small questions / suggestions.
| inputs = {} | ||
| for i, inp in enumerate(node.input): | ||
| nbits = self.get_instream_width(i) | ||
| if nbits == 0: |
There was a problem hiding this comment.
Shouldn't a 0-width input throw an assertion of some kind? Is there a use case where a 0-width input is needed?
| patches = np.arange(12, dtype=np.float32).reshape(1, 3, 4) | ||
| expected = np.concatenate([cls_values, patches], axis=1) | ||
|
|
||
| ret = execute_onnx(model, {"patches": patches}) |
There was a problem hiding this comment.
We've been caught out a few time with tests that rely on particular input names. It might be better to extract the name to use from the model itself {model.graph.input[0].name : patches} sometimes FINN transformations can rename this inputs and it silently fails.
| node.input, | ||
| node.output, | ||
| domain="finn.custom_op.fpgadataflow." + impl_style, | ||
| name=node.name, |
There was a problem hiding this comment.
@auphelia is this okay? Or is it breaking any naming assumptions downstream?
There was a problem hiding this comment.
This should be redundant
finn/src/finn/builder/build_dataflow_steps.py
Line 633 in a15e2ac
Prepends a learned class token, supplied through cls_data, to each input sequence of patch tokens. The class token and patch tokens are transferred as SIMD-wide folds of ELEM_WIDTH-bit elements.