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

Method Compute

tensorflow/core/kernels/random_op.cc:73–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 void Compute(OpKernelContext* ctx) override {
74 const Tensor& shape = ctx->input(0);
75 Tensor* output;
76 OP_REQUIRES_OK(ctx, AllocateOutputWithShape(ctx, shape, 0, &output));
77 auto output_flat = output->flat<T>();
78 functor::FillPhiloxRandom<Device, Distribution>()(
79 ctx, ctx->eigen_device<Device>(),
80 // Multiplier 256 is the same as in FillPhiloxRandomTask; do not change
81 // it just here.
82 generator_.ReserveRandomOutputs(output_flat.size(), 256),
83 output_flat.data(), output_flat.size(), Distribution());
84 }
85
86 private:
87 GuardedPhiloxRandom generator_;

Callers

nothing calls this directly

Calls 6

AllocateOutputWithShapeFunction · 0.85
DistributionClass · 0.85
ReserveRandomOutputsMethod · 0.80
inputMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected