From 3f60681470963d0e7b29920b80d360271c310c7a Mon Sep 17 00:00:00 2001 From: pytorchbot Date: Tue, 23 Jan 2024 21:42:58 +0000 Subject: [PATCH] auto-generating sphinx docs --- .../tutorials_python.zip | Bin 96826 -> 96826 bytes .../tutorials_jupyter.zip | Bin 119382 -> 119382 bytes _sources/sg_execution_times.rst.txt | 16 +- _sources/tutorials/data_fashion.rst.txt | 226 +++++++-------- _sources/tutorials/sg_execution_times.rst.txt | 16 +- .../tutorials/tensorclass_fashion.rst.txt | 234 ++++++++-------- .../tutorials/tensorclass_imagenet.rst.txt | 18 +- _sources/tutorials/tensordict_keys.rst.txt | 2 +- _sources/tutorials/tensordict_memory.rst.txt | 2 +- _sources/tutorials/tensordict_module.rst.txt | 6 +- .../tensordict_module_functional.rst.txt | 2 +- _sources/tutorials/tensordict_shapes.rst.txt | 18 +- ...dict.nn.ProbabilisticTensorDictModule.html | 13 +- .../tensordict.nn.TensorDictModule.html | 15 +- .../tensordict.nn.TensorDictSequential.html | 13 +- searchindex.js | 2 +- sg_execution_times.html | 16 +- tutorials/data_fashion.html | 226 +++++++-------- tutorials/sg_execution_times.html | 16 +- tutorials/tensorclass_fashion.html | 260 +++++++++--------- tutorials/tensorclass_imagenet.html | 18 +- tutorials/tensordict_keys.html | 2 +- tutorials/tensordict_memory.html | 2 +- tutorials/tensordict_module.html | 6 +- tutorials/tensordict_module_functional.html | 2 +- tutorials/tensordict_shapes.html | 18 +- 26 files changed, 578 insertions(+), 571 deletions(-) diff --git a/_downloads/315c4c52fb68082a731b192d944e2ede/tutorials_python.zip b/_downloads/315c4c52fb68082a731b192d944e2ede/tutorials_python.zip index d82406b836d6f0fe182d16ab7459e469abb1241b..0a1c7b62c0db0204514dd2c1f7f495c465540153 100644 GIT binary patch delta 175 zcmdn>g>}~#R-OQFW)=|!5O}#}BTugc)2lU`XG{Fx0?|{I7Yl)CE3g>}~#R-OQFW)=|!5SSRTk*8OJX=23Y*%CjvK=f4Q#X=z3%4{DGi2mg?Qw1!Z zUSR;F7xT|hV%iw7S#Z}e1*S6*n{VEl7S41rVtb(xqm(O9etK^?qXUROU(V1H6> zf0B(Y6X)8^z2_OVnN-$pp786HCX?pc?KLWlO6g2mYqu}xW_;-kR5`u-JR_LCaGuc% z#Fx3i=mMgXE-?Cm=uHXS>80 F000ljODO;V delta 177 zcmcb%g#FqQcAfxlW)=|!5SSRTk>|M-)5M6)U!~3nfat^8yfPsAlKUfJ5WOvWx*3S} zpJZdpv@v3H?|DXTrZW+nC;WP)$#gMddyNXCQaaP6i0uoy8DBaBRZj0d&j_Y3oM-d` z@ntSBx`61U3ygjsdea3)M-ct>0#Mz?i0M`r8C`)UPH()(Xa_WL`oW7p@kProbabilisticTensorDictModule>>> td_module = ProbabilisticTensorDictSequential( ... module, normal_params, prob_module ... ) ->>> params = make_functional(td_module, funs_to_decorate=["forward", "get_dist", "log_prob"]) ->>> _ = td_module(td, params=params) +>>> params = TensorDict.from_module(td_module) +>>> with params.to_module(td_module): +... _ = td_module(td) >>> print(td) TensorDict( fields={ @@ -486,13 +487,17 @@

ProbabilisticTensorDictModule batch_size=torch.Size([3]), device=None, is_shared=False) ->>> dist = td_module.get_dist(td, params=params) +>>> with params.to_module(td_module): +... dist = td_module.get_dist(td) >>> print(dist) Normal(loc: torch.Size([3, 4]), scale: torch.Size([3, 4])) >>> # we can also apply the module to the TensorDict with vmap >>> from torch import vmap >>> params = params.expand(4) ->>> td_vmap = vmap(td_module, (None, 0))(td, params) +>>> def func(td, params): +... with params.to_module(td_module): +... return td_module(td) +>>> td_vmap = vmap(func, (None, 0))(td, params) >>> print(td_vmap) TensorDict( fields={ diff --git a/reference/generated/tensordict.nn.TensorDictModule.html b/reference/generated/tensordict.nn.TensorDictModule.html index d4e988a46..37b0179ab 100644 --- a/reference/generated/tensordict.nn.TensorDictModule.html +++ b/reference/generated/tensordict.nn.TensorDictModule.html @@ -371,9 +371,6 @@

TensorDictModule class tensordict.nn.TensorDictModule(*args, **kwargs)

A TensorDictModule, is a python wrapper around a nn.Module that reads and writes to a TensorDict.

-

By default, TensorDictModule subclasses are always functional, -meaning that they support the td_module(input, params=params) function -call signature.

Parameters: