# AttributeError: module 'torch' has no attribute 'where

**URL:** <https://discuss.pytorch.org/t/attributeerror-module-torch-has-no-attribute-where/53591>\
**Category:** Uncategorized\
**Created:** [August 17, 2019, 8:37am UTC](https://discuss.pytorch.org/t/attributeerror-module-torch-has-no-attribute-where/53591 "2019-08-17T08:37:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![spanev](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/spanev/32/14892_2.png) [@spanev](https://discuss.pytorch.org/u/spanev)\
**Post date:** [August 17, 2019, 9:35am UTC](https://discuss.pytorch.org/t/attributeerror-module-torch-has-no-attribute-where/53591/2 "2019-08-17T09:35:27Z")

</div>

Hi @solsol

`torch.where` was added in v0.4.0 [Release Trade-off memory for compute, Windows support, 24 distributions with cdf, variance etc., dtypes, zero-dimensional Tensors, Tensor-Variable merge, , faster distributed, perf and bug fixes, CuDNN 7.1 · pytorch/pytorch · GitHub](https://github.com/pytorch/pytorch/releases/tag/v0.4.0)

> [@How can I do the operation the same as \`np.where\`?](https://discuss.pytorch.org/t/how-can-i-do-the-operation-the-same-as-np-where/1329/8):
>
> @truenicoco, torch.where() looks like it’'s in 0.4! [http://pytorch.org/docs/master/torch.html#torch.where](http://pytorch.org/docs/master/torch.html#torch.where) thanks others for examples of other options for 0.3 and before

---

_[View the full topic](https://discuss.pytorch.org/t/attributeerror-module-torch-has-no-attribute-where/53591)._
