convert_tensor.cc
imports tensorflow/core/platform/bfloat16.himports tensorflow/core/platform/errors.h
SHA-2568b3950d6f1f03e96b27f65a570eb5ee0dbc692fe1ae111d7ecc90c04f83cb240
MaleculeMd(In₆)
Evidence
1/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/core/ir/importexport/convert_tensor.h"
17
18#include <optional>
19#include <string>
20#include <vector>
21
22#include "llvm/ADT/APFloat.h"
23#include "llvm/ADT/ArrayRef.h"
24#include "llvm/ADT/SmallVector.h"
25#include "mlir/IR/Attributes.h" // from @llvm-project
26#include "mlir/IR/Builders.h" // from @llvm-project
27#include "mlir/IR/BuiltinTypes.h" // from @llvm-project
28#include "mlir/IR/Types.h" // from @llvm-project
29#include "mlir/Support/LLVM.h" // from @llvm-project
30#include "tensorflow/core/framework/tensor.h"
31#include "tensorflow/core/framework/tensor.pb.h"
32#include "tensorflow/core/framework/tensor_shape.pb.h"
33#include "tensorflow/core/framework/types.pb.h"
34#include "tensorflow/core/ir/dialect.h"
35#include "tensorflow/core/ir/importexport/convert_types.h"
36#include "tensorflow/core/ir/importexport/mangling.h"
37#include "tensorflow/core/ir/types/dialect.h"
38#include "tensorflow/core/lib/core/errors.h"
39#include "tensorflow/core/platform/bfloat16.h"
40#include "tensorflow/core/platform/errors.h"
41#include "tensorflow/core/platform/protobuf.h"
42#include "tensorflow/core/platform/statusor.h"
43#include "tensorflow/core/platform/tstring.h"
44#include "tsl/platform/ml_dtypes.h"
45
46namespace mlir {
⋯5 lines
147:42… lex<double>)
148
149 // BFLOAT16 is a special case that it needs to be cast to double type to
150 // match its storage type.
151 case tensorflow::DT_BF …