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

Method NewTensorTie

tensorflow/lite/delegates/gpu/cl/api.cc:382–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380 }
381
382 Status NewTensorTie(const TensorTieDef& def,
383 std::unique_ptr<TensorTie>* tie) {
384 TensorObject internal_object = TensorToObj(*context_.GetTensor(def.id));
385 auto converter = converter_builder_.get();
386 if (NoopTensorTie::IsSupported(def)) {
387 return NoopTensorTie::New(def, internal_object, tie);
388 }
389 if (DefaultTensorTie::IsSupported(def, converter)) {
390 return DefaultTensorTie::New(def, internal_object, converter, &env_, tie);
391 }
392 if (GlBufferHolder::IsSupported(def, converter)) {
393 if (!gl_interop_fabric_) {
394 return InvalidArgumentError(
395 "GL object is used but InferenceEnvironmentOptions does not have "
396 "EGL display and context set.");
397 }
398 return GlBufferHolder::New(def, internal_object, converter,
399 gl_interop_fabric_, &env_, tie);
400 }
401 if (TwoStepTensorTie::IsSupported(def, converter)) {
402 return TwoStepTensorTie::New(def, internal_object, converter, &env_, tie);
403 }
404 return UnimplementedError("Unsupported tensor tie definition.");
405 }
406
407 private:
408 Environment& env_;

Callers 1

LinkTensorsMethod · 0.80

Calls 6

TensorToObjFunction · 0.85
IsSupportedFunction · 0.50
InvalidArgumentErrorFunction · 0.50
UnimplementedErrorFunction · 0.50
GetTensorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected