Reduce dispatch overhead if the user has set the target device explicitly. It mainly contains two parts: 1. Only infer type attribute like "T" if we need to use op placement logic from existing TF. 2. Only put attributes in "_node_def_". So if users don't specify attribute explicitly, "_node_def_" will be an empty string,
Reduce dispatch overhead if the user has set the target device explicitly. It mainly contains two parts:
1. Only infer type attribute like "T" if we need to use op placement logic from existing TF.
2. Only put attributes in "_node_def_". So if users don't specify attribute explicitly, "_node_def_" will be an empty string,

PiperOrigin-RevId: 324876499

tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime