/external/tensorflow/tensorflow/python/util/ |
D | py_checkpoint_reader.i | 28 tensorflow::Safe_PyObjectPtr output_map(tensorflow::make_safe(PyDict_New())); 32 tensorflow::make_safe(PyUnicode_FromStringAndSize(v.first.c_str(), 36 tensorflow::make_safe(PyString_FromStringAndSize(v.first.c_str(), 43 tensorflow::Safe_PyObjectPtr value(tensorflow::make_safe(PyList_New(dims))); 50 tensorflow::make_safe(PyLong_FromLong(v.second.dim_size(i)))); 53 tensorflow::make_safe(PyInt_FromLong(v.second.dim_size(i)))); 72 tensorflow::Safe_PyObjectPtr output_map(tensorflow::make_safe(PyDict_New())); 76 tensorflow::make_safe(PyUnicode_FromStringAndSize(v.first.c_str(), v.first.size()))); 79 tensorflow::make_safe(PyString_FromStringAndSize(v.first.c_str(), v.first.size()))); 85 tensorflow::Safe_PyObjectPtr value(tensorflow::make_safe(PyLong_FromLong(v.second))); [all …]
|
D | util.cc | 870 Safe_PyObjectPtr fields = make_safe(PyObject_GetAttrString(o, "_fields")); in IsNamedtuple() 879 Safe_PyObjectPtr seq = make_safe(PySequence_Fast(fields.get(), "")); in IsNamedtuple() 893 Safe_PyObjectPtr f1 = make_safe(PyObject_GetAttrString(o1, "_fields")); in SameNamedtuples() 894 Safe_PyObjectPtr f2 = make_safe(PyObject_GetAttrString(o2, "_fields")); in SameNamedtuples()
|
/external/tensorflow/tensorflow/python/lib/core/ |
D | safe_ptr.cc | 20 Safe_PyObjectPtr make_safe(PyObject* object) { in make_safe() function 24 Safe_TF_TensorPtr make_safe(TF_Tensor* tensor) { in make_safe() function 28 Safe_TFE_TensorHandlePtr make_safe(TFE_TensorHandle* handle) { in make_safe() function 32 Safe_TF_StatusPtr make_safe(TF_Status* status) { in make_safe() function
|
D | safe_ptr.h | 50 Safe_PyObjectPtr make_safe(PyObject* o); 55 Safe_TF_TensorPtr make_safe(TF_Tensor* tensor); 61 Safe_TFE_TensorHandlePtr make_safe(TFE_TensorHandle* handle); 66 Safe_TF_StatusPtr make_safe(TF_Status* status);
|
D | py_seq_tensor.cc | 89 Safe_PyObjectPtr repr_obj = make_safe(PyObject_Repr(obj)); in PyRepr() 149 refs_to_clean.push_back(make_safe(obj)); in InferShapeAndType() 160 refs_to_clean.push_back(make_safe(obj)); in InferShapeAndType() 239 Safe_PyObjectPtr seq = make_safe(PySequence_Fast(obj, "")); \ 252 Safe_PyObjectPtr seq = make_safe(PySequence_Fast(obj, "")); \ 307 Safe_PyObjectPtr as_int = make_safe(PyNumber_Int(v)); in ConvertOneInt64() 309 Safe_PyObjectPtr as_int = make_safe(PyNumber_Long(v)); in ConvertOneInt64() 333 Safe_PyObjectPtr as_int = make_safe(PyNumber_Int(v)); in ConvertOneInt32() 335 Safe_PyObjectPtr as_int = make_safe(PyNumber_Long(v)); in ConvertOneInt32() 388 Safe_PyObjectPtr as_float = make_safe(PyNumber_Float(v)); in ConvertOneFloat() [all …]
|
D | ndarray_tensor.cc | 170 Safe_PyObjectPtr iter = tensorflow::make_safe( in PyBytesArrayMap() 173 auto item = tensorflow::make_safe(PyArray_GETITEM( in PyBytesArrayMap() 242 auto iter = make_safe(PyArray_IterNew(reinterpret_cast<PyObject*>(dst))); in CopyTF_TensorStringsToPyArray() 253 auto py_string = make_safe(PyBytes_FromStringAndSize(ptr, len)); in CopyTF_TensorStringsToPyArray() 389 tensorflow::make_safe(PyArray_Empty(dims.size(), dims.data(), descr, 0)); in TF_TensorToPyArray() 420 Safe_PyObjectPtr array_safe(make_safe( in PyArrayToTF_Tensor() 443 *out_tensor = make_safe(TF_NewTensor(dtype, {}, 0, PyArray_DATA(array), in PyArrayToTF_Tensor() 449 *out_tensor = make_safe(TF_NewTensor(dtype, dims.data(), dims.size(), in PyArrayToTF_Tensor() 457 make_safe(TF_NewTensor(dtype, dims.data(), dims.size(), encoded, size, in PyArrayToTF_Tensor() 471 Safe_TF_TensorPtr tf_tensor = make_safe(static_cast<TF_Tensor*>(nullptr)); in NdarrayToTensor() [all …]
|
D | strings.i | 86 auto temp_string_list = tensorflow::make_safe(PyList_New(size)); 99 converted.emplace_back(tensorflow::make_safe(py_str));
|
D | bfloat16.cc | 98 make_safe(PyBfloat16_Type.tp_alloc(&PyBfloat16_Type, 0)); in PyBfloat16_FromBfloat16() 538 Safe_PyObjectPtr numpy_str = make_safe(MakePyString("numpy")); in Initialize() 542 Safe_PyObjectPtr numpy = make_safe(PyImport_Import(numpy_str.get())); in Initialize() 610 make_safe(PyObject_GetAttrString(numpy.get(), name)); in Initialize()
|
/external/tensorflow/tensorflow/compiler/xla/python/ |
D | numpy_bridge.cc | 29 Safe_PyObjectPtr make_safe(PyObject* object) { in make_safe() function 137 dimensions = make_safe(PyTuple_New(ShapeUtil::TupleElementCount(shape))); in PyShapeInfoFromXlaShape() 146 dimensions = make_safe(PyTuple_New(rank)); in PyShapeInfoFromXlaShape() 152 return make_safe(PyTuple_Pack(2, np_dtype, dimensions.release())); in PyShapeInfoFromXlaShape() 157 Safe_PyObjectPtr arg_shapes = make_safe(PyTuple_New(shape.parameters_size())); in PyProgramShapeInfoFromXlaProgramShape() 164 return make_safe( in PyProgramShapeInfoFromXlaProgramShape() 378 Safe_PyObjectPtr tuple = make_safe(PyTuple_New(num_elements)); in PyObjectFromXlaLiteral() 390 Safe_PyObjectPtr array = make_safe( in PyObjectFromXlaLiteral()
|
D | numpy_bridge.h | 47 Safe_PyObjectPtr make_safe(PyObject* object);
|
/external/tensorflow/tensorflow/python/eager/ |
D | pywrap_tensor.cc | 95 auto status = tensorflow::make_safe(TF_NewStatus()); in CopyToDevice() 246 auto safe_value = tensorflow::make_safe(static_cast<PyObject*>(nullptr)); in ConvertToEagerTensor() 251 safe_value = tensorflow::make_safe( in ConvertToEagerTensor() 418 tensorflow::make_safe(static_cast<TFE_TensorHandle*>( in EagerTensor_init() 425 handle = tensorflow::make_safe(tensorflow::EagerCast( in EagerTensor_init() 488 handle = tensorflow::make_safe(CopyToDevice(handle.get(), context, device)); in EagerTensor_init() 649 auto status = tensorflow::make_safe(TF_NewStatus()); in EagerTensor_numpy() 999 auto tensor = tensorflow::make_safe(TF_AllocateTensor( in TFE_Py_TensorShapeSlice() 1002 auto status = tensorflow::make_safe(TF_NewStatus()); in TFE_Py_TensorShapeSlice() 1062 auto status = tensorflow::make_safe(TF_NewStatus()); in TFE_Py_TensorShapeOnDevice()
|
D | pywrap_tfe_src.cc | 1702 tensorflow::make_safe(PySequence_Fast(target, "expected a sequence")); 2189 *handle = tensorflow::make_safe( 2201 *handle = tensorflow::make_safe(TFE_TensorHandleCopyToDevice( 2302 tensorflow::make_safe(static_cast<TFE_TensorHandle*>(
|
/external/tensorflow/tensorflow/python/client/ |
D | tf_session_helper.cc | 91 inputs_safe.emplace_back(make_safe(static_cast<TF_Tensor*>(nullptr))); in TF_Run_wrapper_helper() 137 tf_outputs_safe.emplace_back(make_safe(output)); in TF_Run_wrapper_helper() 150 py_outputs_safe.emplace_back(make_safe(py_array)); in TF_Run_wrapper_helper() 220 Safe_PyObjectPtr feed_values_holder(make_safe(feed_values)); in RunCallableHelper() 280 py_outputs_safe.push_back(make_safe(py_array)); in RunCallableHelper() 389 input_vals_safe.emplace_back(make_safe(static_cast<TF_Tensor*>(nullptr))); in TF_SessionRun_wrapper_helper() 421 output_vals_safe.emplace_back(make_safe(output)); in TF_SessionRun_wrapper_helper() 433 py_outputs_safe.emplace_back(make_safe(py_array)); in TF_SessionRun_wrapper_helper()
|
D | tf_session.i | 249 tensorflow::make_safe(static_cast<PyObject*>(nullptr)))) { 261 temp_string_list = tensorflow::make_safe(PyList_New(len)); 310 out_values_safe.emplace_back(tensorflow::make_safe($1->at(i)));
|