Ask Your Question
2

How to print tensor's name only as a string

asked 2022-05-03 14:09:58 +0200

Liwei gravatar image

Hi, I have a tensor ct = M.tensor_field(1,1, name='c') And I want get the name of ct ('c') as a string. Is there a way to do this? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-05-04 07:45:26 +0200

tmonteil gravatar image

There might be a more official way, but you can use its _name attribute:

sage: ct._name
'c'
edit flag offensive delete link more

Comments

Gotcha. Thanks

Liwei gravatar imageLiwei ( 2022-05-13 06:00:25 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2022-05-03 14:09:58 +0200

Seen: 39 times

Last updated: May 04