Skip to content

Commit f5cc7d0

Browse files
Fixed misleading test case bug in deconv1d
Correct erros of deconv1d unittest Added hint in the header indicating that padtype is not supported yet Added 2 cases for deconv1d Type: Code Improvement Issue: github issue #585 Signed-off-by: Feiyue Chen <Feiyue.Chen@verisilicon.com>
1 parent af50cc5 commit f5cc7d0

File tree

2 files changed

+253
-129
lines changed

2 files changed

+253
-129
lines changed

include/tim/vx/ops/deconv1d.h

+35-39
Original file line numberDiff line numberDiff line change
@@ -42,53 +42,49 @@ namespace ops {
4242
*
4343
* - weights : the channel number for weight tensor.
4444
* - ksize : the length for weight tensor.
45-
* - padding : AUTO, VALID or SAME.
45+
* - padtype : AUTO, VALID or SAME.**
4646
* - pad : pad value for each spatial axis.
4747
* - stride : stride along each spatial axis.
48-
* - output_padding : specifying the amount of padding along the height and width of
49-
* the output tensor.
48+
* - output_padding : additional padding lines added to the output tensor, default is zero
49+
*
50+
* Caution**: PadType is not really supported yet, will be supported in future.
5051
*/
5152

5253
class DeConv1d : public BuiltinOp {
53-
public:
54-
DeConv1d(Graph* graph, PadType pad_type,
55-
uint32_t stride, uint32_t output_padding, uint32_t group = 1,
56-
DataLayout input_layout = DataLayout::WHCN,
57-
DataLayout kernel_layout = DataLayout::WHIcOc);
58-
DeConv1d(Graph* graph, const std::array<uint32_t, 2>& pad,
59-
uint32_t stride, uint32_t output_padding, uint32_t group = 1,
60-
DataLayout input_layout = DataLayout::WHCN,
61-
DataLayout kernel_layout = DataLayout::WHIcOc);
62-
DeConv1d(Graph* graph, int32_t oc_count_, PadType pad_type,
63-
uint32_t ksize,
64-
uint32_t stride,
65-
uint32_t output_padding);
66-
DeConv1d(Graph* graph, int32_t oc_count_, PadType pad_type,
67-
uint32_t ksize,
68-
uint32_t stride,
69-
uint32_t output_padding,
70-
const std::array<uint32_t, 2>& pad,
71-
uint32_t group = 1);
72-
DeConv1d(Graph* graph, PadType pad_type,
73-
uint32_t stride, uint32_t output_padding,
74-
const std::array<uint32_t, 2>& pad, uint32_t group,
75-
DataLayout input_layout, DataLayout kernel_layout);
54+
public:
55+
DeConv1d(Graph* graph, PadType pad_type, uint32_t stride,
56+
uint32_t output_padding, uint32_t group = 1,
57+
DataLayout input_layout = DataLayout::WHCN,
58+
DataLayout kernel_layout = DataLayout::WHIcOc);
59+
DeConv1d(Graph* graph, const std::array<uint32_t, 2>& pad, uint32_t stride,
60+
uint32_t output_padding, uint32_t group = 1,
61+
DataLayout input_layout = DataLayout::WHCN,
62+
DataLayout kernel_layout = DataLayout::WHIcOc);
63+
DeConv1d(Graph* graph, int32_t oc_count_, PadType pad_type, uint32_t ksize,
64+
uint32_t stride, uint32_t output_padding);
65+
DeConv1d(Graph* graph, int32_t oc_count_, PadType pad_type, uint32_t ksize,
66+
uint32_t stride, uint32_t output_padding,
67+
const std::array<uint32_t, 2>& pad, uint32_t group = 1);
68+
DeConv1d(Graph* graph, PadType pad_type, uint32_t stride,
69+
uint32_t output_padding, const std::array<uint32_t, 2>& pad,
70+
uint32_t group, DataLayout input_layout, DataLayout kernel_layout);
7671

77-
std::shared_ptr<Operation> Clone(std::shared_ptr<Graph>& graph) const override;
72+
std::shared_ptr<Operation> Clone(
73+
std::shared_ptr<Graph>& graph) const override;
7874

79-
protected:
80-
const uint32_t oc_count_; // output channel count
81-
const PadType pad_type_;
82-
const uint32_t ksize_;
83-
const uint32_t stride_;
84-
const uint32_t output_padding_;
85-
const std::array<uint32_t, 2> pad_;
86-
const uint32_t group_;
87-
const DataLayout kernel_layout_;
75+
protected:
76+
const uint32_t oc_count_; // output channel count
77+
const PadType pad_type_;
78+
const uint32_t ksize_;
79+
const uint32_t stride_;
80+
const uint32_t output_padding_;
81+
const std::array<uint32_t, 2> pad_;
82+
const uint32_t group_;
83+
const DataLayout kernel_layout_;
8884
};
8985

90-
} // namespace ops
91-
} // namespace vx
92-
} // namespace tim
86+
} // namespace ops
87+
} // namespace vx
88+
} // namespace tim
9389

9490
#endif /* TIM_VX_OPS_DECONV1D_H_ */

0 commit comments

Comments
 (0)