- Allow creating complex and unsigned scalar tensor in TFRT.
- Use AbstractContext to create Tensor to support creating Tensor when turning TFRT on. PiperOrigin-RevId: 333421621 Change-Id: I0f877fa347fc84521d9a3e7c6a2636af389cf597
This commit is contained in:
parent
9709a5af66
commit
01b975d175
@ -880,10 +880,13 @@ TFE_TensorHandle* PySeqToTFE_TensorHandle(TFE_Context* ctx, PyObject* obj,
|
||||
|
||||
case DT_INVALID: // Only occurs for empty tensors.
|
||||
{
|
||||
Tensor tensor(requested_dtype == DT_INVALID ? DT_FLOAT : requested_dtype,
|
||||
TensorShape(state.inferred_shape));
|
||||
TensorInterface t(std::move(tensor));
|
||||
return tensorflow::wrap(tensorflow::unwrap(ctx)->CreateLocalHandle(&t));
|
||||
AbstractTensorInterface* t = tensorflow::unwrap(ctx)->CreateTensor(
|
||||
requested_dtype == DT_INVALID ? DT_FLOAT : requested_dtype,
|
||||
state.inferred_shape);
|
||||
auto* result =
|
||||
tensorflow::wrap(tensorflow::unwrap(ctx)->CreateLocalHandle(t));
|
||||
t->Release();
|
||||
return result;
|
||||
}
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user