szhengac commented on a change in pull request #18403:
URL: https://github.com/apache/incubator-mxnet/pull/18403#discussion_r434282816



##########
File path: python/mxnet/gluon/probability/distributions/distribution.py
##########
@@ -0,0 +1,196 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# coding: utf-8
+# pylint: disable=wildcard-import
+"""Base distribution class."""
+__all__ = ['Distribution']
+
+from .utils import cached_property
+from numbers import Number
+
+
+class Distribution(object):
+    r"""Base class for distribution.
+    
+    Parameters
+    ----------
+    F : mx.ndarray or mx.symbol.numpy._Symbol
+        Variable that stores the running mode.
+    event_dim : int, default None
+        Variable indicating the dimension of the distribution's support.
+    validate_args : bool, default None
+        Whether to validate the distribution parameters
+    """          
+
+    # Variable indicating whether the sampling method has
+    # pathwise gradient.
+    has_grad = False
+    support = None
+    has_enumerate_support = False
+    arg_constraints = {}
+    _validate_args = False
+
+    @staticmethod
+    def set_default_validate_args(value):
+        if value not in [True, False]:
+            raise ValueError
+        Distribution._validate_args = value
+
+    def __init__(self, F=None, event_dim=None, validate_args=None):
+        self.F = F

Review comment:
       When we started doing this, it was November last year, and Xi told me 
you mentioned that it is not guaranteed that F can be removed before the 
release of 2.0. So we did everything based on the original hybrid block, and we 
cannot test our design if we followed the new api because it was not in MXNET 
at that time. Also, when the deferred compute was merged, we basically finished 
all the module except some functionalities. I remembered that I talked to @szha 
that we can keep F in probability module before. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to