Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
so there is this piece of code I am trying to understand:
rois, target_class_ids, target_bbox, target_mask =\
DetectionTargetLayer(config, name="proposal_targets")([
target_rois, input_gt_class_ids, gt_boxes, input_gt_masks])
DetectionTargetLayer is a Keras subclass layer. So what does the operator =\ mean? Is it just the same as '='?
–
–
\
is not used as an operator, instead, it is used as an equals sign with a line continuation.
I see where you are confused, the code isn't really clear.
=\
is actually not related to equal sign at all.
This code:
rois, target_class_ids, target_bbox, target_mask =\
DetectionTargetLayer(config, name="proposal_targets")([
target_rois, input_gt_class_ids, gt_boxes, input_gt_masks])
is IDENTICAL to this code:
rois, target_class_ids, target_bbox, target_mask = DetectionTargetLayer(config, name="proposal_targets")([target_rois, input_gt_class_ids, gt_boxes, input_gt_masks])
Because, as others have said, like in C, Bash, and many other languages, \
at the end of a line tells the Python interpreter to treat the next line as the same line, and ignore the \
.
This question talks in detail about the usage of the line-continuation token in Python.