def hybrid_forward(self, F, pred, label, valid_length): 
if self._sparse_label:<EOL><INDENT>sample_weight = F.cast(F.expand_dims(F.ones_like(label), axis=-<NUM_LIT:1>), dtype=np.float32)<EOL><DEDENT>else:<EOL><INDENT>sample_weight = F.ones_like(label)<EOL><DEDENT>sample_weight = F.SequenceMask(sample_weight,<EOL>sequence_length=valid_length,<EOL>use_sequence_length=True,<EOL>axis=<NUM_LIT:1>)<EOL>return super(SoftmaxCEMaskedLoss, self).hybrid_forward(F, pred, label, sample_weight)<EOL>
Parameters
----------
F
pred : Symbol or NDArray
    Shape (batch_size, length, V)
label : Symbol or NDArray
    Shape (batch_size, length)
valid_length : Symbol or NDArray
    Shape (batch_size, )
Returns
-------
loss : Symbol or NDArray
    Shape (batch_size,)