gigasquid commented on a change in pull request #13993: [Clojure] Add resource 
scope to clojure package
URL: https://github.com/apache/incubator-mxnet/pull/13993#discussion_r251202219
 
 

 ##########
 File path: 
contrib/clojure-package/test/org/apache/clojure_mxnet/resource_scope_test.clj
 ##########
 @@ -0,0 +1,65 @@
+;;
+;; 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.
+;;
+
+(ns org.apache.clojure-mxnet.resource-scope-test
+  (:require [org.apache.clojure-mxnet.ndarray :as ndarray]
+            [org.apache.clojure-mxnet.symbol :as sym]
+            [org.apache.clojure-mxnet.resource-scope :as resource-scope]
+            [clojure.test :refer :all]))
+
+
+(deftest test-resource-scope-with-ndarray
+  (let [native-resources (atom {})
+        x (ndarray/ones [2 2])
+        return-val (resource-scope/using
 
 Review comment:
   I like where you are going - I think adding an alias for `let` is a good 
idea. It's also like a `do` though because any native resources created in the 
forms will be closed. What do you think about adding aliases for 
`resource-scope/let` and `resource-scope/do` while keeping 
`resource-scope/using` to keep with the Scala api?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to