| 118 | } |
| 119 | |
| 120 | xla::StatusOr<XlaCompilationCache::Signature> |
| 121 | XlaCompilationCache::BuildSignature( |
| 122 | const NameAttrList& function, |
| 123 | absl::Span<const XlaCompiler::Argument> args) { |
| 124 | Signature signature; |
| 125 | signature.name = Canonicalize(function.name(), AttrSlice(&function.attr())); |
| 126 | for (const XlaCompiler::Argument& arg : args) { |
| 127 | switch (arg.kind) { |
| 128 | case XlaCompiler::Argument::kConstant: |
| 129 | signature.arg_values.push_back(arg.constant_value); |
| 130 | break; |
| 131 | case XlaCompiler::Argument::kParameter: |
| 132 | case XlaCompiler::Argument::kResource: |
| 133 | signature.arg_shapes.emplace_back(arg.type, arg.DimensionSizes()); |
| 134 | break; |
| 135 | default: |
| 136 | return errors::InvalidArgument( |
| 137 | "Unhandled argument kind in XlaCompilationCache: ", |
| 138 | arg.HumanString()); |
| 139 | } |
| 140 | } |
| 141 | return std::move(signature); |
| 142 | } |
| 143 | |
| 144 | Status XlaCompilationCache::BuildExecutable( |
| 145 | const XlaCompiler::Options& options, |
nothing calls this directly
no test coverage detected