MCPcopy Create free account
hub / github.com/conflow-dev/ConFlow / Compute

Method Compute

en_ops/e_emb_init.cc:41–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 OP_REQUIRES(context, lib != NULL, errors::Unknown("Unable to load sgx.so!"));
40 }
41 void Compute(OpKernelContext *context) override
42 {
43 Tensor *output = NULL;
44 TensorShape output_shape;
45 output_shape.AddDim(input_dim_);
46 output_shape.AddDim(output_dim_);
47 OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output));
48 auto output_flat = output->flat<float>();
49 unsigned long int eid_ = (eid_high_ << 32) + eid_low_;
50 typedef void (*function)(unsigned long int eid, float *output, int M, int C);
51 dlerror();
52 function emb_init_kernel = (function)dlsym(lib, "emb_init");
53 const char *dlsym_error = dlerror();
54 OP_REQUIRES(context, !dlsym_error, errors::Unknown("loading of emb_init failed: ", dlsym_error));
55 emb_init_kernel(eid_, (float *)output_flat.data(), input_dim_, output_dim_);
56 };
57
58private:
59 void *lib;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected