target_assign
对于每个实例,根据 match_indices
和 negative_indices
位置索引, 给输入 out
和 赋值。输入 input
和 negative_indices
均为2-D LoDTensor。假如 input
中每个实例的行偏移称作lod,该操作计算步骤如下:
1.根据match_indices赋值:
2.如果提供neg_indices,则再次依据该输入赋值:
参数:
input (Variable) - 输入为3-D LoDTensor,为了方便在上述文档中解释,假如维度是[M,P,K]。
name (str) - 具体用法请参见 Name ,一般无需设置,默认值为None。
返回:返回一个元组(out,out_weight)。out是三维张量,维度为[N,P,K],N和P与 matched_indices
中的N和P一致,K和输入X中的K一致。 的维度为[N,P,1]。
代码示例: