LLVM 20.0.0git
|
#include "llvm/Config/llvm-config.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/LLVMContext.h"
#include <memory>
#include <optional>
#include <vector>
Go to the source code of this file.
Classes | |
class | llvm::TensorSpec |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
namespace | llvm::json |
Macros | |
#define | SUPPORTED_TENSOR_TYPES(M) |
TensorSpec encapsulates the specification of a tensor: its dimensions, or "shape" (row-major), its type (see TensorSpec::getDataType specializations for supported types), its name and port (see "TensorFlow: Large-Scale
Machine Learning on Heterogeneous Distributed Systems", section 4.2, para 2: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45166.pdf) | |
#define | _TENSOR_TYPE_ENUM_MEMBERS(_, Name) Name, |
#define | TFUTILS_GETDATATYPE_DEF(T, Name) template <> TensorType TensorSpec::getDataType<T>(); |
Enumerations | |
enum class | llvm::TensorType { llvm::Invalid , llvm::_TENSOR_TYPE_ENUM_MEMBERS , llvm::Total } |
Functions | |
std::string | llvm::tensorValueToString (const char *Buffer, const TensorSpec &Spec) |
For debugging. | |
std::optional< TensorSpec > | llvm::getTensorSpecFromJSON (LLVMContext &Ctx, const json::Value &Value) |
Construct a TensorSpec from a JSON dictionary of the form: { "name": <string>, "port": <int>, "type": <string. | |
Definition at line 56 of file TensorSpec.h.
#define SUPPORTED_TENSOR_TYPES | ( | M | ) |
TensorSpec encapsulates the specification of a tensor: its dimensions, or "shape" (row-major), its type (see TensorSpec::getDataType specializations for supported types), its name and port (see "TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems", section 4.2, para 2: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45166.pdf)
Note that the design is motivated by Tensorflow, but it is not intended to be Tensorflow-specific.
Known tensor types. The left part is the C type, the right is a name we can use to identify the type (to implement TensorSpec equality checks), and to use, if needed, when mapping to an underlying evaluator's type system. The main requirement is that the C type we use has the same size and encoding (e.g. endian-ness) as the one used by the evaluator.
Definition at line 42 of file TensorSpec.h.
Definition at line 127 of file TensorSpec.h.