()
| 1062 | res = paddle.is_empty(x=valid_img2txt_ind) |
| 1063 | |
| 1064 | def false_func(): |
| 1065 | valid_matching_softmax = paddle.gather(x=matching_softmax, index=valid_img2txt_ind) |
| 1066 | valid_labels = paddle.gather(x=labels, index=valid_img2txt_ind) |
| 1067 | valid_labels = paddle.reshape(x=valid_labels, shape=[-1, 1]) |
| 1068 | matching_acc = paddle.metric.accuracy(input=valid_matching_softmax, label=valid_labels) |
| 1069 | return matching_acc |
| 1070 | |
| 1071 | def true_func(): |
| 1072 | return paddle.zeros(shape=[1], dtype='float32') |