Commit Graph

10 Commits

Author SHA1 Message Date
Hao Lu
4adc5eb6c5 [Caffe2][Testing] Check for equality first in assertTensorEqualsWithType<float> (#61006)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/61006

Test Plan: Modified existing unit test to test for eps = 0. It would fail without the equality test first.

Reviewed By: ajyu

Differential Revision: D29423770

fbshipit-source-id: 168e7de00d8522c4b646a8335d0120700915f260
2021-06-29 23:31:37 -07:00
Hao Lu
33f206b865 [StaticRuntime] Replace StorageImpl with TensorImpl in MemoryPlanner (#56447)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56447

MemoryPlanner shouldn't manage StorageImpls; instead, it should manage the TensorImpls because the StorageImpl in Tensors can change.

Test Plan: CI

Reviewed By: ajyu

Differential Revision: D27840361

fbshipit-source-id: f22165d167c70165be2934c6717b5057a8bb4d29
2021-04-20 23:04:01 -07:00
Yinghai Lu
df514fd8c0 C++ C2/Glow operator unittest
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/32258

Test Plan:
```
 buck test glow/fb/test/numerics:fp16_op_test
```

Reviewed By: bddppq

Differential Revision: D19401786

fbshipit-source-id: 1382b5208be6172d3e6f768dedad7ebec31cffc9
2020-01-17 12:13:34 -08:00
Yinghai Lu
4edf77b6c0 Fuse to individual operators to GatherFuse8BitRowwiseQuantFloatMulLengthElim (#25519)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25519

Fuse  Gather-Fused8BitRowwiseQuantizedToFloat-Mul-LengthsSum opportunistically.

Test Plan:
```
buck test caffe2/caffe2/opt/custom:concat_elim_test
```

Reviewed By: dreamingleo

Differential Revision: D17125045

fbshipit-source-id: 8ee50410eb13a82e1e5c8180f392fce2fe9cd728
2019-09-03 19:08:49 -07:00
Duc Ngo
10b16953d1 nomnigraph - easy - use new test utils in converter_nomnigraph_test (#15751)
Summary:
Use new test utils in converter_nomnigraph_test , and add utils to set device option name, external inputs, outputs.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15751

Differential Revision: D13586228

Pulled By: duc0

fbshipit-source-id: ff809dd7bf9f30641ce2a6fef7e2810f005521c2
2019-01-14 18:38:38 -08:00
Duc Ngo
66b26806fc caffe2 - easy - utils to set argument of operator (#15022)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15022

Add setArgument testing utils to make it easy to set argument for an operator

Reviewed By: yinghai

Differential Revision: D13405225

fbshipit-source-id: b5c1859c6819d53c1a44718e2868e3137067df36
2018-12-13 20:45:50 -08:00
Duc Ngo
9726651d1e caffe2 - easy - test utils for tensor assertion (#15020)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15020

Add test utils for assertion of a tensor (sizes and values)

Reviewed By: salexspb

Differential Revision: D13401146

fbshipit-source-id: bc385df074043e03ea884940b5631b96de4a607e
2018-12-13 20:45:48 -08:00
Duc Ngo
d0b4ae835d caffe2 - easy - test utils to compare tensors in two workspaces (#15181)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15181

Add test utils to compare tensors in two workspaces

Reviewed By: ZolotukhinM

Differential Revision: D13387212

fbshipit-source-id: e19d932a1ecc696bd0a08ea14d9a7485cce67bb2
2018-12-13 20:45:46 -08:00
Duc Ngo
8fedde5530 caffe2 - easy - test utils to create operator (#15180)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15180

Test utils to create an operator

On top of D13370461

Reviewed By: ZolotukhinM

Differential Revision: D13382773

fbshipit-source-id: a88040ed5a60f31d3e73f1f958219cd7338dc52e
2018-12-13 20:45:42 -08:00
Duc Ngo
eb6fec3652 caffe2 - easy - Create test_util to make it easier to write C++ unit tests (#15014)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15014

Currently it looks like many of the simple operations such as comparing tensors, creating tensors, fetching tensors... are too verbose and took effort to write correctly in unit tests.
Easy to use utilities are often more important to increase productivity writing unit tests. While caffe2 python unit tests are relatively easier to write at the moment, the C++ side seems lacking.
In this change I create a test_util, started with assertsTensorEquals, getTensor, createTensor, and we can start putting more easy to use utilities there.

Reviewed By: salexspb

Differential Revision: D13370461

fbshipit-source-id: bee467a127e1d032ef19482f98aa5c776cf508c0
2018-12-13 20:45:41 -08:00