Construct a TensorSpec from a JSON dictionary describing the tensor.
Declared in <llvm/Analysis/TensorSpec.h>
std::optional<TensorSpec>
getTensorSpecFromJSON(
LLVMContext& Ctx,
json::Value const& Value);
The dictionary has the form: { "name": <string>, "port": <int>, "type": <string. Use LLVM's types, e.g. float, double, int64_t>, "shape": <array of ints> } For the "type" field, see the C++ primitive types used in TFUTILS_SUPPORTED_TYPES.
A TensorSpec on success, or std::nullopt if Value is invalid.
| Name | Description |
|---|---|
| Ctx | LLVM context used for diagnostics if the JSON is invalid. |
| Value | JSON value expected to be a dictionary with name, port, type, and shape fields. |