Home | History | Annotate | Download | only in framework

Lines Matching refs:types_pb2

22 from tensorflow.core.framework import types_pb2
74 type_enum: A `types_pb2.DataType` enum value.
77 TypeError: If `type_enum` is not a value `types_pb2.DataType`.
83 if (type_enum not in types_pb2.DataType.values() or
84 type_enum == types_pb2.DT_INVALID):
86 "type_enum is not a valid types_pb2.DataType: %s" % type_enum)
124 types_pb2.DT_VARIANT, types_pb2.DT_VARIANT_REF, types_pb2.DT_RESOURCE,
125 types_pb2.DT_RESOURCE_REF
136 """Returns a `types_pb2.DataType` enum value based on this `DType`."""
302 if (self._type_enum == types_pb2.DT_VARIANT or
303 self._type_enum == types_pb2.DT_RESOURCE):
324 # Define standard wrappers for the types_pb2.DataType enum.
325 resource = DType(types_pb2.DT_RESOURCE)
327 variant = DType(types_pb2.DT_VARIANT)
329 float16 = DType(types_pb2.DT_HALF)
333 float32 = DType(types_pb2.DT_FLOAT)
335 float64 = DType(types_pb2.DT_DOUBLE)
339 int32 = DType(types_pb2.DT_INT32)
341 uint8 = DType(types_pb2.DT_UINT8)
343 uint16 = DType(types_pb2.DT_UINT16)
345 uint32 = DType(types_pb2.DT_UINT32)
346 uint64 = DType(types_pb2.DT_UINT64)
347 int16 = DType(types_pb2.DT_INT16)
349 int8 = DType(types_pb2.DT_INT8)
351 string = DType(types_pb2.DT_STRING)
353 complex64 = DType(types_pb2.DT_COMPLEX64)
355 complex128 = DType(types_pb2.DT_COMPLEX128)
357 int64 = DType(types_pb2.DT_INT64)
359 bool = DType(types_pb2.DT_BOOL) # pylint: disable=redefined-builtin
361 qint8 = DType(types_pb2.DT_QINT8)
363 quint8 = DType(types_pb2.DT_QUINT8)
365 qint16 = DType(types_pb2.DT_QINT16)
367 quint16 = DType(types_pb2.DT_QUINT16)
369 qint32 = DType(types_pb2.DT_QINT32)
371 resource_ref = DType(types_pb2.DT_RESOURCE_REF)
372 variant_ref = DType(types_pb2.DT_VARIANT_REF)
373 bfloat16 = DType(types_pb2.DT_BFLOAT16)
375 float16_ref = DType(types_pb2.DT_HALF_REF)
377 float32_ref = DType(types_pb2.DT_FLOAT_REF)
378 float64_ref = DType(types_pb2.DT_DOUBLE_REF)
380 int32_ref = DType(types_pb2.DT_INT32_REF)
381 uint32_ref = DType(types_pb2.DT_UINT32_REF)
382 uint8_ref = DType(types_pb2.DT_UINT8_REF)
383 uint16_ref = DType(types_pb2.DT_UINT16_REF)
384 int16_ref = DType(types_pb2.DT_INT16_REF)
385 int8_ref = DType(types_pb2.DT_INT8_REF)
386 string_ref = DType(types_pb2.DT_STRING_REF)
387 complex64_ref = DType(types_pb2.DT_COMPLEX64_REF)
388 complex128_ref = DType(types_pb2.DT_COMPLEX128_REF)
389 int64_ref = DType(types_pb2.DT_INT64_REF)
390 uint64_ref = DType(types_pb2.DT_UINT64_REF)
391 bool_ref = DType(types_pb2.DT_BOOL_REF)
392 qint8_ref = DType(types_pb2.DT_QINT8_REF)
393 quint8_ref = DType(types_pb2.DT_QUINT8_REF)
394 qint16_ref = DType(types_pb2.DT_QINT16_REF)
395 quint16_ref = DType(types_pb2.DT_QUINT16_REF)
396 qint32_ref = DType(types_pb2.DT_QINT32_REF)
397 bfloat16_ref = DType(types_pb2.DT_BFLOAT16_REF)
402 types_pb2.DT_HALF: float16,
403 types_pb2.DT_FLOAT: float32,
404 types_pb2.DT_DOUBLE: float64,
405 types_pb2.DT_INT32: int32,
406 types_pb2.DT_UINT8: uint8,
407 types_pb2.DT_UINT16: uint16,
408 types_pb2.DT_UINT32: uint32,
409 types_pb2.DT_UINT64: uint64,
410 types_pb2.DT_INT16: int16,
411 types_pb2.DT_INT8: int8,
412 types_pb2.DT_STRING: string,
413 types_pb2.DT_COMPLEX64: complex64,
414 types_pb2.DT_COMPLEX128: complex128,
415 types_pb2.DT_INT64: int64,
416 types_pb2.DT_BOOL: bool,
417 types_pb2.DT_QINT8: qint8,
418 types_pb2.DT_QUINT8: quint8,
419 types_pb2.DT_QINT16: qint16,
420 types_pb2.DT_QUINT16: quint16,
421 types_pb2.DT_QINT32: qint32,
422 types_pb2.DT_BFLOAT16: bfloat16,
423 types_pb2.DT_RESOURCE: resource,
424 types_pb2.DT_VARIANT: variant,
425 types_pb2.DT_HALF_REF: float16_ref,
426 types_pb2.DT_FLOAT_REF: float32_ref,
427 types_pb2.DT_DOUBLE_REF: float64_ref,
428 types_pb2.DT_INT32_REF: int32_ref,
429 types_pb2.DT_UINT32_REF: uint32_ref,
430 types_pb2.DT_UINT8_REF: uint8_ref,
431 types_pb2.DT_UINT16_REF: uint16_ref,
432 types_pb2.DT_INT16_REF: int16_ref,
433 types_pb2.DT_INT8_REF: int8_ref,
434 types_pb2.DT_STRING_REF: string_ref,
435 types_pb2.DT_COMPLEX64_REF: complex64_ref,
436 types_pb2.DT_COMPLEX128_REF: complex128_ref,
437 types_pb2.DT_INT64_REF: int64_ref,
438 types_pb2.DT_UINT64_REF: uint64_ref,
439 types_pb2.DT_BOOL_REF: bool_ref,
440 types_pb2.DT_QINT8_REF: qint8_ref,
441 types_pb2.DT_QUINT8_REF: quint8_ref,
442 types_pb2.DT_QINT16_REF: qint16_ref,
443 types_pb2.DT_QUINT16_REF: quint16_ref,
444 types_pb2.DT_QINT32_REF: qint32_ref,
445 types_pb2.DT_BFLOAT16_REF: bfloat16_ref,
446 types_pb2.DT_RESOURCE_REF: resource_ref,
447 types_pb2.DT_VARIANT_REF: variant_ref,
450 # Standard mappings between types_pb2.DataType values and string names.
452 types_pb2.DT_HALF: "float16",
453 types_pb2.DT_FLOAT: "float32",
454 types_pb2.DT_DOUBLE: "float64",
455 types_pb2.DT_INT32: "int32",
456 types_pb2.DT_UINT8: "uint8",
457 types_pb2.DT_UINT16: "uint16",
458 types_pb2.DT_UINT32: "uint32",
459 types_pb2.DT_UINT64: "uint64",
460 types_pb2.DT_INT16: "int16",
461 types_pb2.DT_INT8: "int8",
462 types_pb2.DT_STRING: "string",
463 types_pb2.DT_COMPLEX64: "complex64",
464 types_pb2.DT_COMPLEX128: "complex128",
465 types_pb2.DT_INT64: "int64",
466 types_pb2.DT_BOOL: "bool",
467 types_pb2.DT_QINT8: "qint8",
468 types_pb2.DT_QUINT8: "quint8",
469 types_pb2.DT_QINT16: "qint16",
470 types_pb2.DT_QUINT16: "quint16",
471 types_pb2.DT_QINT32: "qint32",
472 types_pb2.DT_BFLOAT16: "bfloat16",
473 types_pb2.DT_RESOURCE: "resource",
474 types_pb2.DT_VARIANT: "variant",
475 types_pb2.DT_HALF_REF: "float16_ref",
476 types_pb2
477 types_pb2.DT_DOUBLE_REF: "float64_ref",
478 types_pb2.DT_INT32_REF: "int32_ref",
479 types_pb2.DT_UINT32_REF: "uint32_ref",
480 types_pb2.DT_UINT8_REF: "uint8_ref",
481 types_pb2.DT_UINT16_REF: "uint16_ref",
482 types_pb2.DT_INT16_REF: "int16_ref",
483 types_pb2.DT_INT8_REF: "int8_ref",
484 types_pb2.DT_STRING_REF: "string_ref",
485 types_pb2.DT_COMPLEX64_REF: "complex64_ref",
486 types_pb2.DT_COMPLEX128_REF: "complex128_ref",
487 types_pb2.DT_INT64_REF: "int64_ref",
488 types_pb2.DT_UINT64_REF: "uint64_ref",
489 types_pb2.DT_BOOL_REF: "bool_ref",
490 types_pb2.DT_QINT8_REF: "qint8_ref",
491 types_pb2.DT_QUINT8_REF: "quint8_ref",
492 types_pb2.DT_QINT16_REF: "qint16_ref",
493 types_pb2.DT_QUINT16_REF: "quint16_ref",
494 types_pb2.DT_QINT32_REF: "qint32_ref",
495 types_pb2.DT_BFLOAT16_REF: "bfloat16_ref",
496 types_pb2.DT_RESOURCE_REF: "resource_ref",
497 types_pb2.DT_VARIANT_REF: "variant_ref",
528 # Standard mappings between types_pb2.DataType values and numpy.dtypes.
553 types_pb2.DT_HALF:
555 types_pb2.DT_FLOAT:
557 types_pb2.DT_DOUBLE:
559 types_pb2.DT_INT32:
561 types_pb2.DT_UINT8:
563 types_pb2.DT_UINT16:
565 types_pb2.DT_UINT32:
567 types_pb2.DT_UINT64:
569 types_pb2.DT_INT16:
571 types_pb2.DT_INT8:
575 types_pb2.DT_STRING:
577 types_pb2.DT_COMPLEX64:
579 types_pb2.DT_COMPLEX128:
581 types_pb2.DT_INT64:
583 types_pb2.DT_BOOL:
585 types_pb2.DT_QINT8:
587 types_pb2.DT_QUINT8:
589 types_pb2.DT_QINT16:
591 types_pb2.DT_QUINT16:
593 types_pb2.DT_QINT32:
595 types_pb2.DT_BFLOAT16:
599 types_pb2.DT_HALF_REF:
601 types_pb2.DT_FLOAT_REF:
603 types_pb2.DT_DOUBLE_REF:
605 types_pb2.DT_INT32_REF:
607 types_pb2.DT_UINT32_REF:
609 types_pb2.DT_UINT8_REF:
611 types_pb2.DT_UINT16_REF:
613 types_pb2.DT_INT16_REF:
615 types_pb2.DT_INT8_REF:
617 types_pb2.DT_STRING_REF:
619 types_pb2.DT_COMPLEX64_REF:
621 types_pb2.DT_COMPLEX128_REF:
623 types_pb2.DT_INT64_REF:
625 types_pb2.DT_UINT64_REF:
627 types_pb2.DT_BOOL_REF:
629 types_pb2.DT_QINT8_REF:
631 types_pb2.DT_QUINT8_REF:
633 types_pb2.DT_QINT16_REF:
635 types_pb2.DT_QUINT16_REF:
637 types_pb2.DT_QINT32_REF:
639 types_pb2.DT_BFLOAT16_REF: