InputTensors
Function Usage
Sets the input Tensor pointer. During Shape inference, the input Tensor pointer can be obtained from InferShapeContext constructed using the Builder class. For a data-dependent operator, TensorData of the input Tensor corresponding to the data dependency must be set to the correct host address. For a non-data-dependent operator, TensorData of Tensor must be set to a null pointer.
Prototype
1 | OpInferShapeContextBuilder &InputTensors(const std::vector<gert::Tensor *> &inputs) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
inputs |
Input |
Input Tensor pointer array, which is managed by the caller. The caller must ensure that the lifecycle of the input pointer is longer than that of the ContextHolder object generated by Build. |
Returns
A reference to the OpInferShapeContextBuilder object. It is used for chaining method calls.
Constraints
This API must be called before the Build method call. Otherwise, the constructed InferShapeContext will contain undefined data.