일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Nav2 document
- nav2 development guides
- ros2 remapping
- ros2 development guides
- nav2 first-time robot setup guide
- first-time robot setup guide
- ROS FOXY 튜토리얼
- Python
- ros2 configuring environment
- nav2 getting started
- nav2 dev contatiner
- docker foxy
- foxy nav2
- humble development guides
- ros2 foxy tutorial
- ros2 transformations 개념
- humble 환경설정
- ros2 foxy docker
- nav2 튜토리얼
- setting up transformations
- ros2 튜토리얼 환경설정
- 코드업
- ros2 튜토리얼
- nav2 설치
- error
- ros2 환경설정
- CodeUp
- Foxy tutorial
- nav2 tutorial
- CODEUP 6073
Archives
- Today
- Total
BAN2ARU
[Python/Pytorch] TORCH.IS_TENSOR : Torch Tensor 여부 확인 본문
반응형
torch.is_tensor(obj )
obj가 PyTorch tensor라면 True를 return함
이 함수는 isinstance(obj, Tensor)을 수행하며, mypy를 통해 typechecking시에는 isinstance를 활용하는 편이 더 좋음
Parameters
obj (Object) - test할 객체(object)
Example
>>> import torch
>>> a = torch.tensor([1, 3, 5])
>>> torch.is_tensor(a)
True
>>> b = [1, 3, 5]
>>> torch.is_tensor(b)
False
Reference
https://pytorch.org/docs/stable/torch.html
torch — PyTorch 1.11.0 documentation
Shortcuts
pytorch.org
728x90
'Language > Python' 카테고리의 다른 글
Comments