Evaluators need to store variable(tensor) in an op
Created by: typhoonzero
When start writing an evaluator operator, I found that I have to store a global status like total_samples
and total_score
to calculate the error rate of current forward iteration, so that I can increase these values every forward, like total_samples += batch_size
and total_score += score
.
A simply thought is to add a member function CreateOpVar
in InferShapeContext
, and name the variable like [operator_id]_var_name
to avoid variable name conflict.
Can we discuss about whether we need to add this to current framework?