You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result of list(set()) is random under some circumstances. It can be easily reproduced by running python -c 'print(list(set(["fa", "dsa", "dsa", "w"])))'.
In some cases, the code snippet above can result in the difference of DFG returned by get_data_flow() and cause varying CodeBLUE scores (specifically dataflow_match_score):
candidate = \
'''
throws IOException {
int read = super.read(b, off, len);
if (read > 0) {
bytesRead.incrementAndGet();
}
return read;
}
'''
reference = \
'''
throws IOException {
// Obey InputStream contract.
checkPositionIndexes(off, off + len, b.length);
if (len == 0) {
return 0;
}
// The rest of this method implements the process described by the CharsetEncoder javadoc.
int totalBytesRead = 0;
boolean doneEncoding = endOfInput;
DRAINING:
while (true) {
// We stay in draining mode until there are no bytes left in the output buffer. Then we go
// back to encoding/flushing.
if (draining) {
to
'''
I was wondering if #104 ran into the same problem.
CodeXGLUE/Code-Code/code-to-code-trans/evaluator/CodeBLEU/dataflow_match.py
Line 100 in 6744a7f
The result of
list(set())
is random under some circumstances. It can be easily reproduced by runningpython -c 'print(list(set(["fa", "dsa", "dsa", "w"])))'
.In some cases, the code snippet above can result in the difference of DFG returned by
get_data_flow()
and cause varying CodeBLUE scores (specificallydataflow_match_score
):CodeXGLUE/Code-Code/code-to-code-trans/evaluator/CodeBLEU/calc_code_bleu.py
Lines 64 to 67 in 6744a7f
I have compared these two functions and found that in
GraphCodeBERT
there is no "merge nodes" action.https://github.com/microsoft/CodeBERT/blob/ac04c77ca7cda9dc757dc8b4360e358731c8708e/GraphCodeBERT/codesearch/run.py#L68-L104
CodeXGLUE/Code-Code/code-to-code-trans/evaluator/CodeBLEU/dataflow_match.py
Lines 64 to 105 in 6744a7f
My reference and candidate is:
I was wondering if #104 ran into the same problem.
Thank you for your replying! @JiyangZhang @Imagist-Shuo @celbree
Tasks
The text was updated successfully, but these errors were encountered: