Home
last modified time | relevance | path

Searched refs:tensor_proto (Results 1 – 25 of 94) sorted by relevance

1234

/external/tensorflow/tensorflow/python/framework/
Dfast_tensor_util.pyx10 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray): argument
14 tensor_proto.half_val.append(nparray[i])
22 tensor_proto, np.ndarray[np.uint16_t, ndim=1] nparray): argument
26 tensor_proto.half_val.append(nparray[i])
30 tensor_proto, np.ndarray[np.float32_t, ndim=1] nparray): argument
34 tensor_proto.float_val.append(nparray[i])
38 tensor_proto, np.ndarray[np.float64_t, ndim=1] nparray): argument
42 tensor_proto.double_val.append(nparray[i])
46 tensor_proto, np.ndarray[np.int32_t, ndim=1] nparray): argument
50 tensor_proto.int_val.append(nparray[i])
[all …]
Dtensor_util.py46 def SlowAppendFloat16ArrayToTensorProto(tensor_proto, proto_values): argument
47 tensor_proto.half_val.extend(
51 def _MediumAppendFloat16ArrayToTensorProto(tensor_proto, proto_values): argument
54 tensor_proto,
63 def SlowAppendBFloat16ArrayToTensorProto(tensor_proto, proto_values): argument
64 tensor_proto.half_val.extend(
68 def FastAppendBFloat16ArrayToTensorProto(tensor_proto, proto_values): argument
70 tensor_proto, np.asarray(
122 def SlowAppendFloat32ArrayToTensorProto(tensor_proto, proto_values): argument
123 tensor_proto.float_val.extend([x.item() for x in proto_values])
[all …]
/external/tensorflow/tensorflow/core/framework/
Dtensor_util_test.cc463 TensorProto tensor_proto = in TEST() local
465 EXPECT_FALSE(tensor::CompressTensorProtoInPlace(&tensor_proto)); in TEST()
466 tensor_proto = in TEST()
468 EXPECT_FALSE(tensor::CompressTensorProtoInPlace(&tensor_proto)); in TEST()
469 tensor_proto = in TEST()
471 EXPECT_FALSE(tensor::CompressTensorProtoInPlace(&tensor_proto)); in TEST()
472 tensor_proto = in TEST()
474 EXPECT_FALSE(tensor::CompressTensorProtoInPlace(&tensor_proto)); in TEST()
475 tensor_proto = in TEST()
477 EXPECT_FALSE(tensor::CompressTensorProtoInPlace(&tensor_proto)); in TEST()
[all …]
/external/tensorflow/tensorflow/core/kernels/
Dunique_op_test.cc41 TensorProto tensor_proto; in GetRandomInt32TensorProto() local
42 tensor_proto.set_dtype(DT_INT32); in GetRandomInt32TensorProto()
43 tensor_proto.mutable_tensor_shape()->add_dim()->set_size(dim); in GetRandomInt32TensorProto()
44 tensor_proto.mutable_tensor_shape()->set_unknown_rank(false); in GetRandomInt32TensorProto()
47 tensor_proto.add_int_val(int_val); in GetRandomInt32TensorProto()
49 return tensor_proto; in GetRandomInt32TensorProto()
54 TensorProto tensor_proto; in GetRandomInt32TensorProtoWithRepeat() local
55 tensor_proto.set_dtype(DT_INT32); in GetRandomInt32TensorProtoWithRepeat()
56 tensor_proto.mutable_tensor_shape()->add_dim()->set_size(dim); in GetRandomInt32TensorProtoWithRepeat()
57 tensor_proto.mutable_tensor_shape()->set_unknown_rank(false); in GetRandomInt32TensorProtoWithRepeat()
[all …]
Dcontrol_flow_ops_test.cc182 TensorProto tensor_proto; in TEST() local
184 .Attr("value", tensor_proto) in TEST()
190 .Attr("value", tensor_proto) in TEST()
/external/tensorflow/tensorflow/dtensor/cc/
Dsmall_constant_optimization.cc104 TensorProto tensor_proto; in ExtractSmallTensorValue() local
105 tensor_proto.set_dtype(datatype); in ExtractSmallTensorValue()
110 &tensor_proto); in ExtractSmallTensorValue()
116 &tensor_proto); in ExtractSmallTensorValue()
122 &tensor_proto); in ExtractSmallTensorValue()
128 &tensor_proto); in ExtractSmallTensorValue()
147 shape.AsProto(tensor_proto.mutable_tensor_shape()); in ExtractSmallTensorValue()
148 AddNodeAttr("value", tensor_proto, &node_def); in ExtractSmallTensorValue()
/external/tensorflow/tensorflow/core/kernels/data/experimental/
Dauto_shard_dataset_op_test.cc249 TensorProto tensor_proto; in TEST_F() local
251 .Attr("value", tensor_proto) in TEST_F()
259 .Attr("value", tensor_proto) in TEST_F()
264 .Attr("value", tensor_proto) in TEST_F()
305 TensorProto tensor_proto; in TEST_F() local
307 .Attr("value", tensor_proto) in TEST_F()
315 .Attr("value", tensor_proto) in TEST_F()
356 TensorProto tensor_proto; in TEST_F() local
358 .Attr("value", tensor_proto) in TEST_F()
366 .Attr("value", tensor_proto) in TEST_F()
[all …]
/external/tensorflow/tensorflow/c/
Dkernels_test.cc404 ::tensorflow::TensorProto tensor_proto; in TEST_F()
405 tensor_proto.mutable_tensor_shape()->add_dim()->set_size(2); in TEST_F()
406 tensor_proto.mutable_tensor_shape()->add_dim()->set_size(3); in TEST_F()
407 tensor_proto.set_dtype(DT_INT32); in TEST_F()
408 tensor_proto.add_int_val(1); in TEST_F()
409 tensor_proto.add_int_val(2); in TEST_F()
410 tensor_proto.add_int_val(3); in TEST_F()
411 tensor_proto.add_int_val(4); in TEST_F()
412 tensor_proto.add_int_val(5); in TEST_F()
413 tensor_proto.add_int_val(6); in TEST_F()
[all …]
/external/tensorflow/tensorflow/core/tpu/
Dvirtual_device.cc79 Status VirtualDevice::MakeTensorFromProto(const TensorProto& tensor_proto, in MakeTensorFromProto() argument
82 Tensor parsed(tensor_proto.dtype()); in MakeTensorFromProto()
84 if (!parsed.FromProto(allocator, tensor_proto)) { in MakeTensorFromProto()
86 tensor_proto.DebugString()); in MakeTensorFromProto()
/external/tensorflow/tensorflow/core/common_runtime/
Dthreadpool_device.cc122 const TensorProto& tensor_proto, const AllocatorAttributes alloc_attrs, in MakeTensorFromProto() argument
124 if (tensor_proto.dtype() > 0 && tensor_proto.dtype() <= DataType_MAX) { in MakeTensorFromProto()
125 Tensor parsed(tensor_proto.dtype()); in MakeTensorFromProto()
126 if (parsed.FromProto(allocator_, tensor_proto)) { in MakeTensorFromProto()
132 tensor_proto.DebugString()); in MakeTensorFromProto()
Dsingle_threaded_cpu_device.cc61 Status MakeTensorFromProto(const TensorProto& tensor_proto, in MakeTensorFromProto() argument
64 Tensor parsed(tensor_proto.dtype()); in MakeTensorFromProto()
65 if (!parsed.FromProto(cpu_allocator(), tensor_proto)) { in MakeTensorFromProto()
/external/tensorflow/tensorflow/core/grappler/optimizers/
Devaluation_utils.cc50 Status DeviceSimple::MakeTensorFromProto(const TensorProto& tensor_proto, in MakeTensorFromProto() argument
53 Tensor parsed(tensor_proto.dtype()); in MakeTensorFromProto()
54 if (!parsed.FromProto(cpu_allocator(), tensor_proto)) { in MakeTensorFromProto()
/external/tensorflow/tensorflow/core/grappler/costs/
Dgraph_properties.cc402 TensorProto tensor_proto; in MakeTensorProtoFromShape() local
403 tensor_proto.set_dtype(dtype); in MakeTensorProtoFromShape()
404 auto* shape_proto = tensor_proto.mutable_tensor_shape(); in MakeTensorProtoFromShape()
412 tensor_proto.add_int_val(value); in MakeTensorProtoFromShape()
414 tensor_proto.add_int64_val(value); in MakeTensorProtoFromShape()
417 return tensor_proto; in MakeTensorProtoFromShape()
422 const TensorProto& tensor_proto, in MakeConstNodeDefFromTensorProto() argument
430 *tensor = tensor_proto; in MakeConstNodeDefFromTensorProto()
475 uint64 NumElementsFromTensorProto(const TensorProto& tensor_proto) { in NumElementsFromTensorProto() argument
476 if (!tensor_proto.has_tensor_shape()) { in NumElementsFromTensorProto()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/tfrt/tests/tf_to_corert/
Dconst_tensor.mlir24 // CHECK-LABEL: func @tensor_proto
25 func.func @tensor_proto() -> tensor<!tf_type.quint8> {
28 …%0 = "tf.Const"() {value = #tf_type<tensor_proto : "0x746674656E736F722464747970653A2044545F515549…
/external/tensorflow/tensorflow/core/debug/
Ddebug_io_utils.cc129 TensorProto* tensor_proto, in WrapStringTensorAsEvents() argument
131 const protobuf::RepeatedPtrField<string>& strs = tensor_proto->string_val(); in WrapStringTensorAsEvents()
160 num_chunks, i, tensor_proto->dtype(), in WrapStringTensorAsEvents()
161 tensor_proto->tensor_shape()); in WrapStringTensorAsEvents()
166 tensor_proto->mutable_string_val()); in WrapStringTensorAsEvents()
190 TensorProto tensor_proto; in WrapTensorAsEvents() local
195 tensor.AsProtoField(&tensor_proto); in WrapTensorAsEvents()
198 debug_node_key, wall_time_us, chunk_size_limit, &tensor_proto, events)); in WrapTensorAsEvents()
200 tensor.AsProtoTensorContent(&tensor_proto); in WrapTensorAsEvents()
202 const size_t total_length = tensor_proto.tensor_content().size(); in WrapTensorAsEvents()
[all …]
Ddebug_grpc_testlib.cc54 const TensorProto& tensor_proto = val.tensor(); in SendEvents() local
55 Tensor tensor(tensor_proto.dtype()); in SendEvents()
56 if (!tensor.FromProto(tensor_proto)) { in SendEvents()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/utils/
Dconvert_tensor.cc62 TensorProto tensor_proto; in ConvertToProto() local
70 input_tensor.AsProtoTensorContent(&tensor_proto); in ConvertToProto()
72 input_tensor.AsProtoField(&tensor_proto); in ConvertToProto()
73 return tensor_proto; in ConvertToProto()
482 TensorProto tensor_proto; in ConvertToTensor() local
483 TF_RETURN_IF_ERROR(ConvertToTensorProto(attr, &tensor_proto)); in ConvertToTensor()
484 if (!output_tensor->FromProto(tensor_proto)) { in ConvertToTensor()
/external/tensorflow/tensorflow/core/ir/importexport/
Dconvert_tensor.cc59 TensorProto tensor_proto; in ConvertToProto() local
67 input_tensor.AsProtoTensorContent(&tensor_proto); in ConvertToProto()
69 input_tensor.AsProtoField(&tensor_proto); in ConvertToProto()
70 return tensor_proto; in ConvertToProto()
481 TensorProto tensor_proto; in ConvertToTensor() local
482 TF_RETURN_IF_ERROR(ConvertToTensorProto(attr, &tensor_proto)); in ConvertToTensor()
483 if (!output_tensor->FromProto(tensor_proto)) { in ConvertToTensor()
/external/tensorflow/tensorflow/core/transforms/utils/
Deval_utils.cc66 const tensorflow::TensorProto &tensor_proto, in MakeTensorFromProto() argument
69 tensorflow::Tensor parsed(tensor_proto.dtype()); in MakeTensorFromProto()
70 if (!parsed.FromProto(tensorflow::cpu_allocator(), tensor_proto)) { in MakeTensorFromProto()
/external/tensorflow/tensorflow/python/debug/lib/
Ddebug_data.py57 def __init__(self, tensor_proto, initialized=True): argument
65 self._tensor_proto = tensor_proto
116 tensor_proto = event.summary.value[0].tensor
117 shape = tensor_util.TensorShapeProtoToList(tensor_proto.tensor_shape)
122 if tensor_proto.tensor_content or tensor_proto.string_val or not num_elements:
124 if tensor_proto.dtype == types_pb2.DT_RESOURCE:
125 tensor_value = InconvertibleTensorProto(tensor_proto)
128 tensor_value = tensor_util.MakeNdarray(tensor_proto)
130 tensor_value = InconvertibleTensorProto(tensor_proto)
133 tensor_value = InconvertibleTensorProto(tensor_proto, False)
Ddumping_callback.py509 tensor_proto = _concrete_tensor_to_proto(
516 tensor_proto = tensor_pb2.TensorProto()
520 tensor_proto = _concrete_tensor_to_proto(
527 tensor_proto = tensor_pb2.TensorProto()
529 tensor_proto = _concrete_tensor_to_proto(tensor)
530 if tensor_proto:
531 execution_proto.tensor_protos.append(tensor_proto)
/external/tensorflow/tensorflow/compiler/mlir/quantization/tensorflow/passes/
Dconvert_tf_quant_ops_to_mhlo.cc131 tensorflow::TensorProto tensor_proto; in matchAndRewrite() local
133 tfg::mangling_util::DemangleTensor(tensor_view, &tensor_proto); in matchAndRewrite()
139 if (!t.FromProto(tensor_proto)) { in matchAndRewrite()
/external/tensorflow/tensorflow/core/kernels/data/
Dbatch_dataset_op_test.cc350 TensorProto tensor_proto; in TEST() local
352 .Attr("value", tensor_proto) in TEST()
359 .Attr("value", tensor_proto) in TEST()
364 .Attr("value", tensor_proto) in TEST()
/external/tensorflow/tensorflow/compiler/jit/
Dxla_device.cc505 const TensorProto& tensor_proto, in MakeTensorFromProto() argument
508 Tensor parsed(tensor_proto.dtype()); in MakeTensorFromProto()
509 if (!parsed.FromProto(cpu_allocator(), tensor_proto)) { in MakeTensorFromProto()
511 tensor_proto.DebugString()); in MakeTensorFromProto()
532 Status XlaDevice::MakeTensorFromProto(const TensorProto& tensor_proto, in MakeTensorFromProto() argument
538 return MakeTensorFromProto(device_context, tensor_proto, alloc_attrs, tensor); in MakeTensorFromProto()
/external/tensorflow/tensorflow/python/eager/
Dfunction_saved_model_utils.py81 tensor_proto = (
83 ndarray = tensor_util.MakeNdarray(tensor_proto)
84 if dtypes.as_dtype(tensor_proto.dtype) == dtypes.string:

1234