I have a, for example, numpy array X
with a shape of [500, 20]. I want to convert it to a tuple Y
that has 1 element, which is that numpy array X
. If I call len(Y)
, it should return 1. If I call
type(Y)
, it should return tuple
. If I call Y[0].shape,
it should return [500, 20]. If I call
type(Y[0])
, it should return np.array
. How can I do that? Thanks!
question from:
https://stackoverflow.com/questions/66048291/wrap-a-2-d-array-as-a-tuple 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…