@@ -31,8 +31,10 @@ using gpuStream_t = hipStream_t;
31
31
32
32
#include " paddle/phi/api/include/dll_decl.h"
33
33
#include " paddle/phi/common/data_type.h"
34
+ #include " paddle/phi/common/int_array.h"
34
35
#include " paddle/phi/common/layout.h"
35
36
#include " paddle/phi/common/place.h"
37
+ #include " paddle/phi/common/scalar.h"
36
38
37
39
namespace phi {
38
40
class DenseTensor ;
@@ -47,16 +49,6 @@ namespace paddle {
47
49
48
50
namespace experimental {
49
51
50
- class Tensor ;
51
-
52
- template <typename T>
53
- class ScalarBase ;
54
- using Scalar = paddle::experimental::ScalarBase<Tensor>;
55
-
56
- template <typename T>
57
- class IntArrayBase ;
58
- using IntArray = paddle::experimental::IntArrayBase<Tensor>;
59
-
60
52
class AbstractAutogradMeta {
61
53
public:
62
54
// No AbstractAutogradMeta should be created
@@ -684,22 +676,29 @@ class PADDLE_API Tensor final {
684
676
Tensor floor () const ;
685
677
Tensor gather_nd (const Tensor& index) const ;
686
678
Tensor log () const ;
687
- Tensor roll (const IntArray& shifts, const std::vector<int64_t >& axis) const ;
679
+ Tensor roll (const IntArray& shifts = {},
680
+ const std::vector<int64_t >& axis = {}) const ;
688
681
Tensor scatter (const Tensor& index,
689
682
const Tensor& updates,
690
- bool overwrite) const ;
683
+ bool overwrite = true ) const ;
691
684
Tensor scatter_nd_add (const Tensor& index, const Tensor& updates) const ;
692
685
Tensor abs () const ;
693
686
Tensor assign () const ;
694
687
Tensor elementwise_pow (const Tensor& y) const ;
695
688
Tensor expand (const IntArray& shape) const ;
696
- Tensor matmul (const Tensor& y, bool transpose_x, bool transpose_y) const ;
697
- Tensor max (const IntArray& axis, bool keepdim) const ;
689
+ Tensor matmul (const Tensor& y,
690
+ bool transpose_x = false ,
691
+ bool transpose_y = false ) const ;
692
+ Tensor max (const IntArray& axis = {}, bool keepdim = false ) const ;
698
693
Tensor maximum (const Tensor& y) const ;
699
694
Tensor minimum (const Tensor& y) const ;
700
- Tensor scale (const Scalar& scale, float bias, bool bias_after_scale) const ;
701
- Tensor sum (const IntArray& axis, DataType dtype, bool keepdim) const ;
702
- Tensor tile (const IntArray& repeat_times) const ;
695
+ Tensor scale (const Scalar& scale = 1.0 ,
696
+ float bias = 0.0 ,
697
+ bool bias_after_scale = true ) const ;
698
+ Tensor sum (const IntArray& axis = {},
699
+ DataType dtype = DataType::UNDEFINED,
700
+ bool keepdim = false ) const ;
701
+ Tensor tile (const IntArray& repeat_times = {}) const ;
703
702
};
704
703
705
704
PADDLE_API Tensor operator +(const Scalar& x, const Tensor& y);
0 commit comments