Skip to content

Only check that arguments are Variables in VariableType#4943

Merged
colesbury merged 2 commits intopytorch:masterfrom
colesbury:unpack_any
Jan 31, 2018
Merged

Only check that arguments are Variables in VariableType#4943
colesbury merged 2 commits intopytorch:masterfrom
colesbury:unpack_any

Conversation

@colesbury
Copy link
Copy Markdown
Member

Don't check the ScalarType and Backend of arguments in VariableType.
Instead, only check that arguments are Variables of any type. The
precise type checks are handled by the base type.

Many of our functions take heterogeneous types. There isn't enough
information in Declarations.yaml to ensure the precise types of
arguments in VariableType, which makes it difficult to add new methods.

Don't check the ScalarType and Backend of arguments in VariableType.
Instead, only check that arguments are Variables of any type. The
precise type checks are handled by the base type.

Many of our functions take heterogeneous types. There isn't enough
information in Declarations.yaml to ensure the precise types of
arguments in VariableType, which makes it difficult to add new methods.
}

Tensor & VariableType::unpack_any(const Tensor & t, const char * name, int pos) const {
Variable & VariableType::checked_cast(const Tensor & t, const char * name, int pos) {

This comment was marked as off-topic.

@colesbury colesbury merged commit d444379 into pytorch:master Jan 31, 2018
@colesbury colesbury deleted the unpack_any branch January 31, 2018 17:31
ssnl added a commit to ssnl/pytorch that referenced this pull request Jan 31, 2018
soumith pushed a commit that referenced this pull request Jan 31, 2018
* Revert "Clarify grad_input_mask documentation in derivatives.yaml (#4963)"

This reverts commit 6f3266b.

* Revert "fix triu and tril for zero-strided inputs on gpu (#4962)"

This reverts commit 6c197c2.

* Revert "Add mutex for CPU RNG and move TH to C++ (#4041)"

This reverts commit 96239dd.

* Revert "Support multivariate TransformedDistributions (#4937)"

This reverts commit ca5071d.

* Revert "Only check that arguments are Variables in VariableType (#4943)"

This reverts commit d444379.

* Revert "torch.set_num_threads sets MKL option too (#4949)"

This reverts commit 2aaeec0.
colesbury added a commit to colesbury/pytorch that referenced this pull request Feb 1, 2018
colesbury added a commit that referenced this pull request Feb 1, 2018
…" (#4980)

Revert "Only check that arguments are Variables in VariableType (#4943)"
colesbury added a commit that referenced this pull request Feb 1, 2018
Don't check the ScalarType and Backend of arguments in VariableType.
Instead, only check that arguments are Variables of any type. The
precise type checks are handled by the base type.

Many of our functions take heterogeneous types. There isn't enough
information in Declarations.yaml to ensure the precise types of
arguments in VariableType, which makes it difficult to add new methods.

This is #4943 with a fix to the memset call
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Don't check the ScalarType and Backend of arguments in VariableType.
Instead, only check that arguments are Variables of any type. The
precise type checks are handled by the base type.

Many of our functions take heterogeneous types. There isn't enough
information in Declarations.yaml to ensure the precise types of
arguments in VariableType, which makes it difficult to add new methods.
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
* Revert "Clarify grad_input_mask documentation in derivatives.yaml (pytorch#4963)"

This reverts commit 37c8454.

* Revert "fix triu and tril for zero-strided inputs on gpu (pytorch#4962)"

This reverts commit 9acb9be.

* Revert "Add mutex for CPU RNG and move TH to C++ (pytorch#4041)"

This reverts commit 07b7fe2.

* Revert "Support multivariate TransformedDistributions (pytorch#4937)"

This reverts commit 18bdb4a.

* Revert "Only check that arguments are Variables in VariableType (pytorch#4943)"

This reverts commit a479ca0.

* Revert "torch.set_num_threads sets MKL option too (pytorch#4949)"

This reverts commit 2cfb339.
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…rch#4943)" (pytorch#4980)

Revert "Only check that arguments are Variables in VariableType (pytorch#4943)"
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Don't check the ScalarType and Backend of arguments in VariableType.
Instead, only check that arguments are Variables of any type. The
precise type checks are handled by the base type.

Many of our functions take heterogeneous types. There isn't enough
information in Declarations.yaml to ensure the precise types of
arguments in VariableType, which makes it difficult to add new methods.

This is pytorch#4943 with a fix to the memset call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants