def test_less(): l = sym.Variable("l") r = sym.Variable("r") y = sym.less(l, r) def forward(l, r): return np.less(l, r).astype("float32") def backward(head_grads, l, r): return {'l': np.zeros_like(l)} shape = {'l': (3, 4, 5), 'r': (3, 4, 5)} check_function(y, forward, backward, shape=shape)
def test_less(): l = sym.Variable("l") r = sym.Variable("r") y = sym.less(l, r) def forward(l, r): return np.less(l, r).astype("float32") def backward(head_grads, l, r): return [np.zeros_like(l)] dtype = "float32" inputs = [('l', (3, 4, 5), l), ('r', (3, 4, 5), r)] helper(y, inputs, dtype, forward, backward, need_head_grads=False)