Skip to content

Specialize PADDLE_ENFORCE and throw_on_error for pointer types #3117

Closed
@wangkuiyi

Description

@wangkuiyi

By adding the specialization of throw_on_error for pointer types, we can write

PADDLE_ENFORCE(GlobalScope()->FindVar("variable_name"), 
    "variable_name not defined.");

without wrting the checking of nullptr

PADDLE_ENFORCE(GlobalScope()->FindVar("variable_name") != nullptr, 
    "variable_name not defined.");

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions