24.02.1
|
Go to the documentation of this file.
69 win_src, [&](
const Coordinates &) { memcpy(dst_it.
ptr(), src_it.
ptr(), line_size); }, src_it, dst_it);
72 #ifdef ARM_COMPUTE_ASSERTS_ENABLED
82 std::ios stream_status(
nullptr);
83 stream_status.copyfmt(s);
91 precision = std::numeric_limits<float>().max_digits10;
93 s.precision(precision);
97 size_t print_width = 0;
98 size_t print_height = 0;
117 padding.
left * strides[0];
123 print_width = print_width * num_channels;
126 const uint8_t *ptr = this->
buffer() + start_offset;
129 for (
size_t i = 0; i < slices2D; ++i)
132 int max_element_width = 0;
135 size_t offset = i * strides[2];
136 for (
size_t h = 0; h < print_height; ++h)
138 max_element_width = std::max<int>(
139 max_element_width, max_consecutive_elements_display_width(s,
dt, ptr +
offset, print_width));
146 size_t offset = i * strides[2];
147 for (
size_t h = 0; h < print_height; ++h)
149 print_consecutive_elements(s,
dt, ptr +
offset, print_width, max_element_width, io_fmt.
element_delim);
158 s.copyfmt(stream_status);
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
unsigned int right
right of the border
SimpleTensor< float > src
virtual size_t num_channels() const =0
The number of channels for each tensor element.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
size_t num_channels() const override
The number of channels for each tensor element.
Container for 2D border size.
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
virtual int32_t offset_element_in_bytes(const Coordinates &pos) const =0
The offset in bytes from the beginning of the memory allocation to access the element at position (x,...
ValidRegion valid_region() const override
Valid region of the tensor.
unsigned int top
top of the border
void mark_as_used() const
Marks a tensor as used.
void use_tensor_dimensions(const TensorShape &shape, size_t first_dimension=Window::DimX)
Use the tensor's dimensions to fill the window dimensions.
Interface for CPU tensor.
size_t dimension(size_t index) const override
Return the size of the requested dimension.
const ValidRegion valid_region
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
Strides of an item in bytes.
size_t total_size_upper(size_t dimension) const
Collapses given dimension and above.
size_t num_dimensions() const override
The number of dimensions of the tensor (rank)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
unsigned int bottom
bottom of the border
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Iterator updated by execute_window_loop for each window element.
void mark_as_unused() const
Marks a tensor as unused.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
T x() const
Alias to access the size of the first dimension.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
void print(std::ostream &s, IOFormatInfo io_fmt=IOFormatInfo()) const
Print a tensor to a given stream using user defined formatting information.
void copy_from(const ITensor &src)
Copy the content of another tensor.
bool is_used() const
Flags if the tensor is used or not.
Describe a multidimensional execution window.
TensorShape shape
Shape of the valid region.
Copyright (c) 2017-2024 Arm Limited.
virtual void set_valid_region(const ValidRegion &valid_region)=0
Set the valid region of the tensor.
unsigned int left
left of the border
bool is_data_type_float(DataType dt)
Check if a given data type is of floating point type.
virtual size_t offset_first_element_in_bytes() const =0
The offset from the beginning of the memory allocation to the first element of the tensor.
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
TensorInfo src_info(src_shape, 1, data_type)
Store the tensor's metadata.
T y() const
Alias to access the size of the second dimension.
DataType
Available data types.
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)
Coordinates anchor
Anchor for the start of the valid region.
size_t element_size() const override
Element size in bytes calculated as data_size() * num_channels()
virtual uint8_t * buffer() const =0
Interface to be implemented by the child class to return a pointer to CPU memory.
virtual PaddingSize padding() const =0
Padding of tensor.