MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / PrepareInputs

Function PrepareInputs

test/cpp/jit/layer_test.cc:64–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62using DenseTensor = phi::DenseTensor;
63
64std::vector<Tensor> PrepareInputs(const phi::Place& place) {
65 phi::DeviceContextPool& pool = phi::DeviceContextPool::Instance();
66 auto& dev_ctx = *pool.Get(place);
67
68 DenseTensor t;
69 t.Resize(common::make_ddim({2, 4}));
70 t.mutable_data<float>(place);
71 phi::funcs::set_constant(dev_ctx, &t, static_cast<float>(2.));
72
73 return utils::ToTensors({t});
74}
75
76TEST(CpuLayerTest, Function) {
77 auto func_null = Function();

Callers 1

TESTFunction · 0.70

Calls 6

InstanceFunction · 0.85
make_ddimFunction · 0.85
set_constantFunction · 0.85
ToTensorsFunction · 0.85
GetMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected