enhance(compiler): Add constructor for TensorLambdaArgument moving vector values

This commit is contained in:
Andi Drebes
2022-09-20 15:57:25 +02:00
committed by rudy-6-4
parent 9e24eccc9d
commit 7a3cf64171

View File

@@ -145,6 +145,15 @@ public:
std::copy(value.begin(), value.end(), std::back_inserter(this->value));
}
/// Construct tensor argument by moving the values from the
/// one-dimensional vector `value`, but interpreting the array's
/// values as a linearized multi-dimensional tensor with the sizes
/// of the dimensions specified in `dimensions`.
TensorLambdaArgument(
std::vector<typename ScalarArgumentT::value_type> &&value,
llvm::ArrayRef<int64_t> dimensions)
: dimensions(dimensions.vec()), value(std::move(value)) {}
/// Construct a one-dimensional tensor argument from the
/// array `value`.
TensorLambdaArgument(