@@ -56,29 +56,31 @@ class BufferArg {
56
56
: buf_(buf), valueType_(valueType) {}
57
57
58
58
BufferArg (const Matrix& matrix)
59
- : buf_(( void *) matrix.getData()),
59
+ : buf_(reinterpret_cast < void *>( matrix.getData() )),
60
60
valueType_ (DataType<real>::value),
61
61
shape_(2 ) {
62
62
shape_.setDim (0 , matrix.getHeight ());
63
63
shape_.setDim (1 , matrix.getWidth ());
64
64
}
65
65
66
66
BufferArg (const Matrix& matrix, const TensorShape& shape)
67
- : buf_(( void *) matrix.getData()),
67
+ : buf_(reinterpret_cast < void *>( matrix.getData() )),
68
68
valueType_(DataType<real>::value),
69
69
shape_(shape) {
70
70
CHECK_EQ (matrix.getElementCnt (), shape.getElements ());
71
71
}
72
72
73
73
BufferArg (const Vector& vector)
74
- : buf_(( void *) vector.getData()),
74
+ : buf_(reinterpret_cast < void *>( vector.getData() )),
75
75
valueType_(DataType<real>::value),
76
76
shape_(1 ) {
77
77
shape_.setDim (0 , vector.getSize ());
78
78
}
79
79
80
80
BufferArg (const IVector& vector)
81
- : buf_((void *)vector.getData()), valueType_(VALUE_TYPE_INT32), shape_(1 ) {
81
+ : buf_(reinterpret_cast <void *>(vector.getData())),
82
+ valueType_(VALUE_TYPE_INT32),
83
+ shape_(1 ) {
82
84
shape_.setDim (0 , vector.getSize ());
83
85
}
84
86
@@ -129,7 +131,7 @@ class BufferArg {
129
131
// sequence start positions in a mini-batch of sequences
130
132
// shape_.ndims() == 1
131
133
// valueType_ = int32
132
- // if a < b than value_.buf_[a] < value_.buf_[b]
134
+ // if a < b then value_.buf_[a] < value_.buf_[b]
133
135
class SequenceIdArg : public BufferArg {
134
136
public:
135
137
SequenceIdArg (void * buf, const TensorShape& shape)
@@ -203,13 +205,13 @@ class SparseMatrixArg : public BufferArg {
203
205
204
206
SparseMatrixArg (const CpuSparseMatrix& sparse)
205
207
: BufferArg(sparse),
206
- row_(( void *) sparse.getRows(), VALUE_TYPE_INT32),
207
- col_(( void *) sparse.getCols(), VALUE_TYPE_INT32) {}
208
+ row_(reinterpret_cast < void *>( sparse.getRows() ), VALUE_TYPE_INT32),
209
+ col_(reinterpret_cast < void *>( sparse.getCols() ), VALUE_TYPE_INT32) {}
208
210
209
211
SparseMatrixArg (const GpuSparseMatrix& sparse)
210
212
: BufferArg(sparse),
211
- row_(( void *) sparse.getRows(), VALUE_TYPE_INT32),
212
- col_(( void *) sparse.getCols(), VALUE_TYPE_INT32) {}
213
+ row_(reinterpret_cast < void *>( sparse.getRows() ), VALUE_TYPE_INT32),
214
+ col_(reinterpret_cast < void *>( sparse.getCols() ), VALUE_TYPE_INT32) {}
213
215
214
216
~SparseMatrixArg () {}
215
217
0 commit comments