1.5.1.post107版本动态图下面使用GPU计算equal/not_equal终止,cpu正常
Created by: L-lei
def run(): use_cudnn = False place = fluid.CUDAPlace(0) if use_cudnn else fluid.CPUPlace() with fluid.dygraph.guard(place=place): label = to_variable(np.array([-1, 1, -1, -1]).astype('float32')) limit = to_variable(np.array([1, 1, 1, 1]).astype('float32')) less = fluid.layers.equal(x=label, y=limit) print(less)