Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions src/base/upsample_nearest1d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#ifndef INFINI_OPS_BASE_UPSAMPLE_NEAREST1D_H_
#define INFINI_OPS_BASE_UPSAMPLE_NEAREST1D_H_

#include "operator.h"

namespace infini::ops {

class UpsampleNearest1d : public Operator<UpsampleNearest1d> {
public:
UpsampleNearest1d(const Tensor input, const std::vector<int64_t> output_size,
Tensor out)
: input_shape_{input.shape()},
input_strides_{input.strides()},
input_type_{input.dtype()},
out_shape_{out.shape()},
out_strides_{out.strides()},
out_type_{out.dtype()},
output_size_{output_size},
device_index_{out.device().index()} {}

virtual void operator()(const Tensor input,
const std::vector<int64_t> output_size,
Tensor out) const = 0;

protected:
Tensor::Shape input_shape_;

Tensor::Strides input_strides_;

DataType input_type_;

Tensor::Shape out_shape_;

Tensor::Strides out_strides_;

DataType out_type_;

std::vector<int64_t> output_size_{};

int device_index_{0};
};

} // namespace infini::ops

#endif
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结尾没空行

Loading