|
|
|
@ -41,11 +41,16 @@ void print_lod_tensor(const std::string& var_name,
|
|
|
|
|
void PrintVar(framework::Scope* scope, const std::string& var_name,
|
|
|
|
|
const std::string& print_info) {
|
|
|
|
|
framework::Variable* var = scope->FindVar(var_name);
|
|
|
|
|
framework::LoDTensor* tensor = var->GetMutable<framework::LoDTensor>();
|
|
|
|
|
if (tensor == nullptr) {
|
|
|
|
|
VLOG(1) << "Variable Name " << var_name << " does not exist in your scope";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
framework::LoDTensor* tensor = var->GetMutable<framework::LoDTensor>();
|
|
|
|
|
if (tensor == nullptr) {
|
|
|
|
|
VLOG(1) << "tensor of variable " << var_name
|
|
|
|
|
<< " does not exist in your scope";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define PrintLoDTensorCallback(cpp_type, proto_type) \
|
|
|
|
|
do { \
|
|
|
|
|