All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nd4j.autodiff.samediff.NameScope Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.nd4j.autodiff.samediff;

import lombok.Data;

import java.io.Closeable;

/**
 * Used with {@link SameDiff#withNameScope(String)}
 *
 * @author Alex Black
 */
@Data
public class NameScope implements Closeable {
    private final SameDiff sameDiff;
    private final String name;

    public NameScope(SameDiff sameDiff, String name){
        this.sameDiff = sameDiff;
        this.name = name;
    }

    @Override
    public void close() {
        sameDiff.closeNameScope(this);
    }

    @Override
    public String toString(){
        return "NameScope(" + name + ")";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy