MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IsPinnableOp

Function IsPinnableOp

tensorflow/core/common_runtime/eager/execute.cc:797–811  ·  view source on GitHub ↗

These ops are not pinnable since they generate data. It can be slower to generate and then copy the data instead of just generating the data on the device directly.

Source from the content-addressed store, hash-verified

795// generate and then copy the data instead of just generating the data on the
796// device directly.
797bool IsPinnableOp(const string& op_type) {
798 static const gtl::FlatSet<string>* unpinnable_ops = new gtl::FlatSet<string>({
799 "RandomUniform",
800 "RandomUniformInt",
801 "RandomStandardNormal",
802 "StatelessRandomUniform",
803 "StatelessRandomUniformInt",
804 "StatelessRandomNormal",
805 });
806
807 // XRT ops refer to per-device handles that are not safe to move between
808 // devices.
809 return unpinnable_ops->find(op_type) == unpinnable_ops->end() &&
810 !absl::StartsWith(op_type, "XRT");
811}
812
813// The Op device may be updated if:
814// - A resource touching input is specified: all resource-touching ops run in

Callers 1

MaybeUpdateOpDeviceFunction · 0.85

Calls 3

StartsWithFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected