def hybrid_forward(self, F, x, sampled_values, label, w_all, b_all):
sampled_candidates, expected_count_sampled, expected_count_true = sampled_values<EOL>w_sampled = w_all.slice(begin=(<NUM_LIT:0>, <NUM_LIT:0>), end=(self._num_sampled, None))<EOL>w_true = w_all.slice(begin=(self._num_sampled, <NUM_LIT:0>), end=(None, None))<EOL>b_sampled = b_all.slice(begin=(<NUM_LIT:0>,), end=(self._num_sampled,))<EOL>b_true = b_all.slice(begin=(self._num_sampled,), end=(None,))<EOL>x = x.reshape((-<NUM_LIT:1>, self._in_unit))<EOL>pred_true = (w_true * x).sum(axis=<NUM_LIT:1>) + b_true<EOL>b_sampled = F.reshape(b_sampled, (-<NUM_LIT:1>,))<EOL>pred_sampled = F.FullyConnected(x, weight=w_sampled, bias=b_sampled,<EOL>num_hidden=self._num_sampled)<EOL>if self._remove_accidental_hits:<EOL><INDENT>label_vec = F.reshape(label, (-<NUM_LIT:1>, <NUM_LIT:1>))<EOL>sample_vec = F.reshape(sampled_candidates, (<NUM_LIT:1>, -<NUM_LIT:1>))<EOL>mask = F.broadcast_equal(label_vec, sample_vec) * -<NUM_LIT><EOL>pred_sampled = pred_sampled + mask<EOL><DEDENT>expected_count_sampled = F.reshape(expected_count_sampled,<EOL>shape=(<NUM_LIT:1>, self._num_sampled))<EOL>expected_count_true = expected_count_true.reshape((-<NUM_LIT:1>,))<EOL>pred_true = pred_true - F.log(expected_count_true)<EOL>pred_true = pred_true.reshape((-<NUM_LIT:1>, <NUM_LIT:1>))<EOL>pred_sampled = F.broadcast_sub(pred_sampled, F.log(expected_count_sampled))<EOL>pred = F.concat(pred_true, pred_sampled, dim=<NUM_LIT:1>)<EOL>if self._sparse_label:<EOL><INDENT>new_label = F.zeros_like(label)<EOL><DEDENT>else:<EOL><INDENT>label_vec = F.reshape(label, (-<NUM_LIT:1>, <NUM_LIT:1>))<EOL>new_label_true = F.ones_like(label_vec)<EOL>new_label_sampled = F.zeros_like(pred_sampled)<EOL>new_label = F.Concat(new_label_true, new_label_sampled, dim=<NUM_LIT:1>)<EOL><DEDENT>return pred, new_label<EOL>
Forward computation.