CreateBoolTensor
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Creates a tensor of the bool data type and tensor shape.
Prototype
std::unique_ptr<Tensor> CreateBoolTensor(const std::vector<bool> &value, const std::vector<int64_t> &dims, Format format = FORMAT_ND)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
value |
Input |
Tensor data vector. |
dims |
Input |
Tensor dimension vector. |
format |
Input |
Tensor format. The default value is FORMAT_ND. |
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
std::unique_ptr<Tensor> |
Smart pointer to the created tensor. If the operation fails, nullptr is returned. |
Constraints
None
Examples
1 2 3 4 | EsGraphBuilder builder("graph_name"); std::vector<bool> data = {true, false, true, false}; std::vector<int64_t> dims = {4}; auto tensor = builder.CreateBoolTensor(data,dims); |
Parent topic: EsGraphBuilder