HomeSort by relevance Sort by last modified time
    Searched refs:bfloat16 (Results 1 - 25 of 155) sorted by null

1 2 3 4 5 6 7

  /external/tensorflow/tensorflow/compiler/xla/service/
hlo_evaluator_typed_visitor_bfloat16.cc 21 template class HloEvaluatorTypedVisitor<bfloat16, float>;
  /external/tensorflow/tensorflow/compiler/xla/tests/
bfloat16_test.cc 54 auto x = ConstantR0<bfloat16>(&builder, static_cast<bfloat16>(2.0f));
55 auto y = ConstantR0<bfloat16>(&builder, static_cast<bfloat16>(1.0f));
58 ComputeAndCompareR0<bfloat16>(&builder, static_cast<bfloat16>(3.0f), {},
64 auto x = ConstantR0<bfloat16>(&builder, static_cast<bfloat16>(4.0f));
67 ComputeAndCompareR0<bfloat16>(&builder, static_cast<bfloat16>(1.387f), {}
    [all...]
prng_test.cc 92 UniformTest<bfloat16>(static_cast<bfloat16>(low),
93 static_cast<bfloat16>(high), {}, /*seed=*/seed);
96 UniformTest<bfloat16>(static_cast<bfloat16>(32.75),
97 static_cast<bfloat16>(33), {}, /*seed=*/seed);
98 UniformTest<bfloat16>(static_cast<bfloat16>(32.50),
99 static_cast<bfloat16>(32.75), {}, /*seed=*/seed);
100 UniformTest<bfloat16>(static_cast<bfloat16>(-33.00)
    [all...]
  /external/tensorflow/tensorflow/core/lib/bfloat16/
bfloat16.cc 16 #include "tensorflow/core/lib/bfloat16/bfloat16.h"
22 const uint16_t bfloat16::NAN_VALUE;
23 const uint16_t bfloat16::ZERO_VALUE;
25 B16_DEVICE_FUNC bfloat16::operator Eigen::half() const {
bfloat16.h 44 // see framework/bfloat16.h for description.
45 struct bfloat16 { struct in namespace:tensorflow
48 B16_DEVICE_FUNC bfloat16() : value(ZERO_VALUE) {} function in struct:tensorflow::bfloat16
50 B16_DEVICE_FUNC static bfloat16 truncate_to_bfloat16(const float v) {
51 bfloat16 output;
65 B16_DEVICE_FUNC explicit bfloat16(const float v) { function in struct:tensorflow::bfloat16
69 B16_DEVICE_FUNC explicit bfloat16(const double val) function in struct:tensorflow::bfloat16
70 : bfloat16(static_cast<float>(val)) {}
73 B16_DEVICE_FUNC explicit bfloat16(const complex64& val) function in struct:tensorflow::bfloat16
74 : bfloat16(val.real()) {
76 B16_DEVICE_FUNC explicit bfloat16(const complex128& val) function in struct:tensorflow::bfloat16
79 B16_DEVICE_FUNC explicit bfloat16(const unsigned short val) function in struct:tensorflow::bfloat16
82 B16_DEVICE_FUNC explicit bfloat16(const unsigned int val) function in struct:tensorflow::bfloat16
85 B16_DEVICE_FUNC explicit bfloat16(const int val) function in struct:tensorflow::bfloat16
88 B16_DEVICE_FUNC explicit bfloat16(const long val) function in struct:tensorflow::bfloat16
91 B16_DEVICE_FUNC explicit bfloat16(const long long val) function in struct:tensorflow::bfloat16
95 B16_DEVICE_FUNC explicit bfloat16(const T& val) function in struct:tensorflow::bfloat16
    [all...]
  /external/tensorflow/tensorflow/compiler/xla/client/lib/
quantize_test.cc 30 using bfloat16 = tensorflow::bfloat16;
79 Array2D<bfloat16> GenerateLargeSizeMinCombinedOutput(
98 Array2D<bfloat16> output(output_height, output_width, bfloat16(0.0));
106 const bfloat16 scale_factor =
108 (static_cast<bfloat16>(std::numeric_limits<NativeT>::max() -
114 bfloat16 result =
115 static_cast<bfloat16>(input(h, w) + half_range) * scale_factor +
129 std::vector<bfloat16> GenerateMinCombinedOutput(const QuantizedRange &range)
    [all...]
constants.cc 51 return ConstantR0<bfloat16>(builder, bfloat16::epsilon());
73 return ConstantR0<bfloat16>(builder, bfloat16::lowest());
89 return ConstantR0<bfloat16>(builder, bfloat16::min_positive_normal());
111 return ConstantR0<bfloat16>(builder, bfloat16::highest());
128 return ConstantR0<bfloat16>(
129 builder, bfloat16(std::numeric_limits<float>::quiet_NaN()))
    [all...]
  /external/tensorflow/tensorflow/python/lib/core/
bfloat16_test.py 16 """Test cases for the bfloat16 Python type."""
32 bfloat16 = pywrap_tensorflow.TF_bfloat16_type() variable
53 self._assertFloatIdentical(v, float(bfloat16(v)))
57 self.assertEqual(v, int(bfloat16(v)))
60 self.assertEqual("0", str(bfloat16(0.0)))
61 self.assertEqual("1", str(bfloat16(1.0)))
62 self.assertEqual("-3.5", str(bfloat16(-3.5)))
63 self.assertEqual("0.0078125", str(bfloat16(float.fromhex("1.0p-7"))))
64 self.assertEqual("inf", str(bfloat16(float("inf"))))
65 self.assertEqual("-inf", str(bfloat16(float("-inf")))
    [all...]
bfloat16.cc 18 #include "tensorflow/python/lib/core/bfloat16.h"
78 // Representation of a Python bfloat16 object.
81 bfloat16 value;
91 bfloat16 PyBfloat16_Bfloat16(PyObject* object) {
95 // Constructs a PyBfloat16 object from a bfloat16.
96 Safe_PyObjectPtr PyBfloat16_FromBfloat16(bfloat16 x) {
106 // Converts a Python object to a bfloat16 value. Returns true on success,
108 bool AsBfloat16(PyObject* arg, bfloat16* output) {
119 *output = bfloat16(d);
128 *output = bfloat16(static_cast<float>(l))
    [all...]
  /external/tensorflow/tensorflow/core/framework/
numeric_types.h 27 #include "tensorflow/core/lib/bfloat16/bfloat16.h"
49 static inline tensorflow::bfloat16 FloatToBFloat16(float float_val) {
51 return *reinterpret_cast<tensorflow::bfloat16*>(
54 return *reinterpret_cast<tensorflow::bfloat16*>(
63 struct NumTraits<tensorflow::bfloat16>
64 : GenericNumTraits<tensorflow::bfloat16> {
70 static EIGEN_STRONG_INLINE tensorflow::bfloat16 highest() {
74 static EIGEN_STRONG_INLINE tensorflow::bfloat16 lowest() {
78 static EIGEN_STRONG_INLINE tensorflow::bfloat16 infinity()
    [all...]
bfloat16.h 56 // Conversion routines between an array of float and bfloat16 of
58 void FloatToBFloat16(const float* src, bfloat16* dst, int64 size);
59 void BFloat16ToFloat(const bfloat16* src, float* dst, int64 size);
bfloat16_test.cc 16 #include "tensorflow/core/framework/bfloat16.h"
27 EXPECT_EQ(0.0f, static_cast<float>(bfloat16()));
36 EXPECT_EQ(v, static_cast<float>(static_cast<bfloat16>(v)));
41 bfloat16 a(12);
62 bfloat16 truncated = bfloat16::truncate_to_bfloat16((GetParam().input));
70 bfloat16 rounded = bfloat16::round_to_bfloat16((GetParam().input));
131 bfloat16 b[100];
136 // The relative error should be less than 1/(2^7) since bfloat16
    [all...]
bfloat16.cc 16 #include "tensorflow/core/framework/bfloat16.h"
20 void FloatToBFloat16(const float* src, bfloat16* dst, int64 size) {
34 void BFloat16ToFloat(const bfloat16* src, float* dst, int64 size) {
  /external/tensorflow/tensorflow/core/kernels/
cast_op_impl_bfloat.cc 26 CURRY_TYPES3(CAST_CASE, CPUDevice, bfloat16);
35 functor::CastFunctor<GPUDevice, float, bfloat16> func;
37 inp.flat<bfloat16>(), truncate);
cwise_op_sqrt.cc 20 bfloat16, complex64, complex128);
31 Eigen::half, bfloat16, double, complex64, complex128);
cwise_op_isnan.cc 20 bfloat16);
cwise_op_log.cc 20 bfloat16, complex64, complex128);
concat_op_test.cc 88 ConcatHelper<bfloat16>(iters, 1, dim2);
128 ConcatManyHelper<bfloat16>(iters, 1, dim2);
163 typedef Eigen::TensorMap<Eigen::Tensor<bfloat16, 1, Eigen::RowMajor>,
172 bfloat16* data = new bfloat16[size];
177 kNumCopies * sizeof(bfloat16));
180 std::vector<bfloat16*> inputs(kNumCopies);
184 bfloat16* result = new bfloat16[size];
186 bfloat16* output = &result[j * dim2]
    [all...]
cwise_op_less.cc 20 bfloat16, int32);
22 bfloat16);
cwise_op_less_equal.cc 20 bfloat16, double, int32);
22 int16, bfloat16);
  /external/tensorflow/tensorflow/contrib/tpu/python/tpu/
bfloat16.py 22 from tensorflow.python.tpu.bfloat16 import *
  /external/tensorflow/tensorflow/python/tpu/
bfloat16_test.py 16 """Tests for bfloat16 helper."""
26 from tensorflow.python.tpu import bfloat16
34 with bfloat16.bfloat16_scope() as bf:
41 with bfloat16.bfloat16_scope() as scope:
44 v2 = variable_scope.get_variable("v2", [], dtype=dtypes.bfloat16)
45 self.assertEqual(v2.dtype.base_dtype, dtypes.bfloat16)
bfloat16.py 16 """Helper context for running models with bfloat16."""
51 if requested_dtype == dtypes.bfloat16:
63 var = math_ops.cast(var, dtypes.bfloat16)
71 """Scope class for bfloat16 variables so that the model uses custom getter.
73 This enables variables to be read as bfloat16 type when using get_variable.
  /external/tensorflow/tensorflow/compiler/tests/
sort_ops_test.py 52 [dtypes.bfloat16.as_numpy_dtype, np.float32, np.int32, np.uint32])
61 [dtypes.bfloat16.as_numpy_dtype, np.float32, np.int32, np.uint32])
63 [dtypes.bfloat16.as_numpy_dtype, np.float32, np.int32, np.uint32,
79 [dtypes.bfloat16.as_numpy_dtype, np.float32, np.int32, np.uint32])
81 # Use small input size for bfloat16. Otherwise, we'll get duplicate values
82 # after conversion to bfloat16, so the possible resulting index array is
84 if dtype == dtypes.bfloat16.as_numpy_dtype:
104 [dtypes.bfloat16.as_numpy_dtype, np.float32, np.int32, np.uint32])
106 # Use small input size for bfloat16. Otherwise, we'll get duplicate values
107 # after conversion to bfloat16, so the possible resulting index array i
    [all...]
  /external/tensorflow/tensorflow/compiler/xla/
types.h 36 using ::tensorflow::bfloat16;

Completed in 553 milliseconds

1 2 3 4 5 6 7