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

Function MakeFakeDataOrDie

tensorflow/compiler/xla/client/lib/testing.cc:79–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77} // namespace
78
79std::unique_ptr<GlobalData> MakeFakeDataOrDie(
80 const Shape& shape, Client* client, DebugOptions* debug_opts /*=nullptr*/) {
81 if (DataSizeOfShape(shape) < (1LL << 20)) {
82 StatusOr<Literal> literal_status = MakeFakeLiteral(shape);
83 if (!literal_status.ok()) {
84 // If we got an Unimplemented error, fall back to making the fake data via
85 // an on-device computation.
86 CHECK_EQ(literal_status.status().code(),
87 tensorflow::error::UNIMPLEMENTED);
88 return MakeFakeDataViaDeviceOrDie(shape, client, debug_opts);
89 }
90 return client->TransferToServer(literal_status.ValueOrDie()).ValueOrDie();
91 }
92
93 // If the data is large, generate it on-device.
94 return MakeFakeDataViaDeviceOrDie(shape, client, debug_opts);
95}
96
97std::vector<std::unique_ptr<GlobalData>> MakeFakeArgumentsOrDie(
98 const XlaComputation& computation, Client* client,

Callers 1

MakeFakeArgumentsOrDieFunction · 0.85

Calls 7

DataSizeOfShapeFunction · 0.85
MakeFakeLiteralFunction · 0.85
okMethod · 0.45
codeMethod · 0.45
statusMethod · 0.45
TransferToServerMethod · 0.45

Tested by

no test coverage detected