pytorch/test/cpp
Bin Bao 787ded5103 Add lazy::Shape::numel() (#68314)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68314

Add a convenience to lazy::Shape for counting the number of elements (by multiplying out the dimensions).  This is a method on Tensor, and in switching other lazy tensor shape utils to use aten shape inference, we need numel counts.

Test Plan: add unit tests

Reviewed By: alanwaketan

Differential Revision: D32409138

fbshipit-source-id: 3ae725300f8826d38e45412f46501d5e5f776fb2
2021-11-29 08:38:09 -08:00
..
api [easy][PyTorch] Use at::native::is_nonzero (#67195) 2021-10-26 12:40:32 -07:00
c10d Enable desync root cause analysis for NCCL (#68310) 2021-11-17 20:29:03 -08:00
common
dist_autograd
jit Populate operator_input_sizes_ (#68542) 2021-11-23 12:18:06 -08:00
lazy Add lazy::Shape::numel() (#68314) 2021-11-29 08:38:09 -08:00
lite_interpreter_runtime Back out "Revert D30710710: [Pytorch Edge] Support profiling kineto events from external source" (#66421) 2021-10-12 10:55:29 -07:00
monitor torch.monitor - Initial C++ Stats (#68074) 2021-11-18 21:46:23 -08:00
rpc Remove ProcessGroup from TensorPipeAgent initialization (#68128) 2021-11-11 12:28:55 -08:00
tensorexpr [TensorExpr] Remove non-determinism in iterating over unordered_set of intermediate buffers. (#68277) 2021-11-13 00:50:57 -08:00
__init__.py